所以我想处理下面的文本。我想要的是从每个课程的学分开始按照季节和年份结束数据。所以对于第一类它看起来像这样:与多行正则表达式
3 credits in Philosophical Perspectives
PHIL 101L
PHILOSOPHICAL PERSPECTIVES
B
3
Fall 2014
另外我需要得到他们仍然需要的类。如果您注意到他们在历史中缺少3个学分。这里是我的文字:
3 credits in Philosophical Perspectives
PHIL 101L
PHILOSOPHICAL PERSPECTIVES
B
3
Fall 2014
Student View
3 credits in Fine Arts
ART 160L
HIST WEST ART I
B+
3
Fall 2014
3 credits in History
Still Needed:
Click here to see classes that satisfy this requirement.
3 credits in Literature
ENG 201L
INTRO LINGUISTIC
IP
(3)
Spring 2016
3 credits in Math
Still Needed:
Click here to see classes that satisfy this requirement.
3 credits in Natural Science
BIOL 225L
TOPICS IN NUTRITION
A-
3
Spring 2015
3 credits Ethics/Applied Ethics/Religious Studies
REST 209L
WORLD RELIGIONS
A-
3
Spring 2015
3 credits in Social Science
ECON 104L
PRINC MACROECONOM
T
3
Fall 2014
还有,你试过吗?正则表达式有一个多行修饰符 –
我只能得到这个。 (\ d credits)(。*)(?= \ n)。只抓住第一行。我对于正则表达式很新,并没有真正掌握它。 – MrCokeman