正则表达式之间的匹配 [英] Regex Match Between

查看:77
本文介绍了正则表达式之间的匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下文字

Ad:<font class=value>1234 Blues  </font>

正则表达式

value>([^<]+)

将匹配

value>1234 Blues  

我需要做些什么才能使比赛只返回

What do I need to do for the match to only return

1234 Blues

在表达式中使用"value>"(以使搜索更具体)?

using "value>" in the expression (to make the search more specific)?

推荐答案

尽管我同意约翰·桑德斯(John Saunders)的观点,但这还是该问题的答案(或者至少是我可以提出的一个问题:)

Although I agree with John Saunders, here is the answer to the question (or at least the one that I could come up with :)

<font[^>]*?>(.*?)\s*<\/font>

这篇关于正则表达式之间的匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆