Match patterns, search for a character larger than a character using regular expression

I need a regular expression so that when searching for ">" more.

, eg

for this line I will return - "if x> 2"

and for this line I will get false " <template>"

I tried this - [^<][a-zA-Z0-9_]+[a-zA-Z0-9_ ]*> as a regular expression but the problem is that it finds a substring that matches for example, in <template>it finds template>and returns true.

thank.

EDIT:

I use this regex [^<a-zA-Z0-9_][a-zA-Z0-9_]+[ ]*>, tried it all over the source code of firefox 1.0 and it seems to work fine.

+3
source share
2 answers

, , >, <. :

/^(?=.*>)[^<]+$/

, . , HTML , .

EDIT:

, , , , . , , , .

<[0-9]+template>, :

/^.*(?<!<\d+template)>.*$/

, ++. :

a=b<c>d;

... ++ (, , a = (b < c) > d;).

+3

, . , ++ " > " " > " " > " .

+3

All Articles