Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9843

Using regex to select the text between two characters IF there is text

$
0
0

I have this text:

<a class="_f5rco33" href="/account-settings"><div class="_ojs7nk">Account</div></a>

And I want to grab the word "Account", but when I use this regex

">([^<]*)<"

It returns "" because "settings"><div" is the first valid instance.

My tags and text will change every time I run this, but I want to select what's between > and <, IF it is text, and I can't figure it out.


Viewing all articles
Browse latest Browse all 9843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>