我正在寻找一种从下面的文本中提取名称的方法,即出现在“申请人”和“,请”之间的任何字符串。这可能吗?
Please enter the name of your school.: Test Primary School,Please enter the name(s) of your applicant(s).: Sandra McTest,Please enter the name of your school.: Test Primary School,Please enter the name(s) of your applicant(s).: Grace Test, Brad Test, Lovelace Test,Please enter the name of your school.: Test Primary School,
我真的很感激一些帮助,因为我刚刚开始使用正则表达式。提前致谢。
你可以使用 look-arounds
/(?<=applicant\(s\)\.:).*?(?=Please|$)/gm
它捕获applicant(s).:
字符串和Please
字符串或end of line
.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句