I need a regex to match Test<
string only from Test<OKAY>
and it should not match Test<?>
Test<?> // shouldn't match
Test<OKAY> // should match
I tried Test<[^?]
but it matches Test<O
instead of Test<
from Test<OKAY>
How do I fix this?
After Test<
, you need positive lookahead for non-question-mark characters, followed by >
to indicate the end of the brackets:
Test<(?=[^?]+>)