I'm trying to get the tag HTML in a single regex expression when I have a specific style style='display:none'
and keep the content inside.
The current regex that I'm using:
(<span\sstyle=[\"\'] display[:=]none[\"\'\;] >)|(<\/span>)
Result:
I'm getting a close </span>
when it's not supposed in the line 2 and 4. Demo
CodePudding user response:
Try this
(<span\sstyle=[\"\'] display[:=]none[\"\'\;] >)(?:[\w\s] )(<\/span>)