I have a regex pattern:
\(\s*\'\s*(.*?)\s*\'\)
This pattern means, get any text between ('TEXT').
There is a problem: The text may have a HTML tags.
So I want a pattern. If it didn't find a HTML tags, get the text normally, but if it found a HTML tags, the pattern get the text between the tags.
Example:
If the text is
('foo foo text here')
the pattern gets:
foo foo text here
And if the text is:
('<div class='test'> foo foo text here </div>')
the pattern gets
foo foo text here
So the pattern ignore the HTML tags (if there is any), and grab the text .