-
Interpretation of regex?
can someone plz kindly tell me if my intepretation of the following regular expression is correct.
Code:
String pattern="[A-Z](a-z([A-Z]+)0-9@-)*([^;\\s])*";
Match string that has
1.Capital letter in the starting of the string
2.Followed by zero or more occurence of
1.letter ranging a-z
2.digit ranging from 0-9
3.symbol @
4. symbol -
5.and with atleast one or more occurence of capital letter
ranging from A-Z
3.Followed by anything but except a ; and whitespace
Thanks
-
The pattern can turn up in the middle of a String somewhere, as the beginning-of-line and end-of-line symbols are not used.
Then
Code:
A-Z
0 or more occurrences of
a-z
0 or more occurrences of A-Z
0-9
@
-
0 or more occurences of anything but ; or whitespace
i.e. All of these match from after the third . until before the <space>
Code:
...A+<space>...
...Aa0@-b<space>...
...Aa0@-a0@-b<space>...
...AaA0@-b<space>...
...AaA0@-a0@-b<space>...
-