Reputation: 2246
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.
Upvotes: 12
Views: 43086
Reputation: 30995
You can use:
.*?>(\w+)<
Here you can check a working example:
Upvotes: 5
Reputation: 71538
Possible workaround would be to match non >
characters:
[^>]+(?=<\/a>)
Or you take the substring of each of your results in the code itself.
Upvotes: 12