我试图从文本中提取一些信息。
我目前检索的文字是某种星座,例如:
Aries Some random text
which is on multiple
lines and could content one
of the word above, as love for
example.
Love ★★★✩
Job ★★★✩
Energy ★★★✩
Libra Some random text
which is on multiple
lines and could content one
of the word above, as job for
example.
Love ★★★✩
Job ★★★✩
Energy ★★★✩
Taurus Some random text
which is on multiple
lines and could content one
of the word above, as energy for
example.
Love ★★★✩
Job ★★★★
Energy ★★★★
我目前使用此正则表达式检索一个给定符号的不同值:
Aries([\S\s]*)Love\s*([★✩]{1,4})\sJob\s*([★✩]{1,4})\sEnergy\s*([★✩]{1,4})
但是[\S\s]*
基本上可以捕捉它所能做到的一切,基本上这与我在示例中给出的全文相符。
两种可能性:
谢谢!!!