RegEx取得数字集团首席执行官

时间:2016-10-27 12:17:42

标签: regex

需要RegEx才能找到单词"CEO"并使用下一个号码组。

示例代码:

<td>
<p>John Doe</p>
<p>CEO</p>
<p>tel. <a href="tel:152 444 9595">152 444 9595</a></p>
<p>john.doe@somethingdoejohn.com</p>

1 个答案:

答案 0 :(得分:0)

如何获取零件“tel:152 444 9595”

的简单示例
CEO.*href="(tel:[0-9\s]*)">

如果您想使用正则表达式,请使用regexr.com等工具(不要使用您不想与他人共享的数据)。同时从字符串中删除新行以便于匹配。

.*         arbitrary sequence
[0-9\s]*   match numbers and whitespaces
()         use only this part in the result (depends on type of regex matching)
the rest is used literally at their positions