on-internet
← Community

Regex to match anything not between HTML brackets, and after matching another string

Stack Overflow ·

I have an HTML document which I need to match text in one block, and then match text in another block and put it into a capture group. I am using PCRE regex. The first match will be a static match and stay the same. In the first block this is >Match-Me-First< The second match to be put into a capture group will change. In the second block this is >put-me-into-capture-group< I have the regex to match anything between ><, but I do not know how to have it match Match-Me-First, and then to the negative lookahead to do the capture group. Regex to match anything between <>: (?![^<]*>)(\w+) First blo

Comments

Sign in or sign up to comment and upvote.

No comments yet.