I’m trying to match every > and >> not surrounded by single or double qoutes.
var a = 'hello > you'; // true
var b = 'hello >> you'; // true
var c = '"hello > you"'; // false
var d = '"hello > you" >> you'; // true
var e = "'hello' > you"; // true
var f = "'hello > you'"; // false
I have been working around for some time but have not come op with anything useful.
If you’re only trying to check that the string matches, you could use something like this:
This checks to make sure that, from the beginning, the string has either a quoted section (single or double) or other characters that are not quotes or the greater than sign, followed by a greater-than sign.
This won’t work well for nested quotes (within the string), but it should work for one layer of quotation marks within the string.