正则表达式:如何在“<>"和“<"之间找到位. [英] regular expressions: how to find the bit between the "<>"
本文介绍了正则表达式:如何在“<>"和“<"之间找到位.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在以下字符串中,
Jason< jason@bigcreative.com>
Jason <jason@bigcreative.com>
如何提取尖括号内的零件.我尝试了< \ w>,但没有用.
How can i extract the part inside the angle brackets. I tried <\w> and it didn't work.
想法?如果有区别,我在php中使用preg_match().
Ideas? I'm using preg_match() in php if that makes a difference.
推荐答案
然后使用<(.*?)>
作为正则表达式.
Use <(.*?)>
as regex, then.
这篇关于正则表达式:如何在“<>"和“<"之间找到位.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文