Are you wanting to match all strings with the format <text>othertext</text>, regardless of what the actual text is, as long as there is something there?
If so, you're pretty close.
Code:
$line =~ m!<[^>]*>(\S+)</[^>]*>!
The only obvious problem I see is that <[^>]*> would match an empty bracket <>, because * means zero or more.
Also, you are excluding whitespace from the middle part of the string, but not the two parts within brackets. This RE would match <some text>othertext</some text>, but not <sometext>other text</sometext> Is this really what you want?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.