[英]Ignore First Character in Regex Match
I need to ignore the >
in my regular expression in the beginning. 我需要在开头的正则表达式中忽略
>
。
My regular expression: 我的正则表达式:
/(>(.+)(?=<\/a>))/igm
Matches the following: 匹配以下内容:
How do I tell it to ignore the >
in the beginning? 我怎么告诉它在开始时忽略
>
?
Here is the regular expression on regexr.com. 这是regexr.com上的正则表达式。
Possible workaround would be to match non >
characters: 可能的解决方法是匹配非
>
字符:
[^>]+(?=<\/a>)
Or you take the substring of each of your results in the code itself. 或者您在代码本身中获取每个结果的子字符串。
You can use: 您可以使用:
.*?>(\w+)<
Here you can check a working example: 在这里你可以检查一个工作的例子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.