简体   繁体   中英

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.

Possible workaround would be to match non > characters:

[^>]+(?=<\/a>)

regex101 demo

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:

Debuggex Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM