Answer the question
In order to leave comments, you need to log in
How to exclude a subgroup from a group in a regular expression?
There is a line:
<Н1 class="class1 class2">qweqweqwe</Н1>
and there is a regular expression of the form
(<Н1.*?>.*?</Н1>)
how to change it in such a way that as a result, only
<Н1>qweqweqwe</Н1>
That is, throw out what will be “captured” by the first ". *?"
Important extra. a condition due to which I did not break the group into several: in the end there should be only one group - architectural features ...
Answer the question
In order to leave comments, you need to log in
Regexes and html, html and regexes…
stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
maybe I don’t understand something because it’s too late, but <H1.*?>(.*?)</H1> should be replaced with <H1>$1</H1> is not it?
why don't you split the expression into three different groups and put in the first and third?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question