The xml file contain multiple tags, some of which has a value and some are blank, like
<main>
<text></text> <text> </text> <text></text> <text>test str</text>
<text></text>
</main>
as you can see that there is only one non empty text tag, In npp how do I find such non empty tags in xml using regular expressions. I don't want the expression to match the tags with white-spaces.
So after performing find it should match <text>test str</text>
I have tried <text>(\S+)</text>
but this is not working.
You could use this regex, which looks for a <text>
tag followed by some number of spaces then a non-space character, using a negative lookahead to assert that we are not at the closing tag:
<text>\s*(?!</text>)\S.*?</text>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.