Neighborhoods: Java in this regular expression mean?

Category: Java SE
 
yueying_java_oracle
2010-01-29 03:12:22

Sponsored Links
Pattern p = Pattern.compile ("/ \ \ *. * \ \ * / | \ '. + \' | (\ \ + + | \ \ - | \ \> = | \ \ <=) | \ \ d + \ \. \ \ d * | \ \ w + | \ ". + \" | \ \ S ");

; from the Internet to find some source on Java implementation of the lexical analyzer, operating normally, but can not match the comments and blank lines. One of the regular expressions as shown above, its meaning is unknown brother, hope Big Brother Big Sister enlighten, explain in detail the meaning of the regular expression.
I have dedicated the next tutorial to understand regular expressions, but with this there is the distinction, still do not understand here is what this means. The more detailed the better Ha, thank you ~

Sponsored Links

emzyemcnl
2010-01-29 03:22:00
| representation or, so this regular expression can match multiple strings
.. Below indicates any
/ \ \ *. * \ \ * / ---- / * .. * /
\ '. + \' ---- '..'
(\ \ + + | \ \ - | \ \> = | \ \ <=) - --- more +, or two - or <=
\ \ d + \ \. \ \ d * ; ---- 123.33 with a decimal point after the decimal point numbers can be from 0 to multiple
\ \ w + ; ---- multiple numbers and letters
\. "+ \" ---- ".."
\ \ S ---- [^ \ t \ n \ r \ f]
WHEREAMIIII
2010-01-29 03:41:14
Agree upstairs hey he step ahead
temarial_qq
2010-01-29 03:43:56
Haha, okay, there are meat, or too thank you.
afternoon I finally saw the most:
/ \ \ *. * \ \ * /: ie / * ... * / comment (because * is a special symbol, so front \ \ to escape, matching single / * .. * / comment
\ '. + \': ie single quotes content
\ \ d + \ \. \ \ d *: ie 123.33 with a decimal point after the decimal point numbers can be from 0 to more than match the numbers (including integer and fractional, but did not specify the index form)
\ \ w +: ie multiple characters (numbers or letters form words), matching words
\ ". + \": ie double quotes content matching string
\ \ S ": that is, a non-blank character, matching monocular Special symbols

above these understand, put program can understand, but the following few (ie: \ \ + + | \ \ - | \ \> = | \ \ <=) still do not understand, they are placed exactly match what program content?
\ \ + +: the first two \ \ Escape + second + tables repeated at least once, -,> = and <= front \ \ What does it mean?
procedures for the conduct of lexical analysis, they can ferret out what code do?

I now understand is that, for a piece of code, it is nothing more than the "Comments + space + Digital + Identifier + Monocular special symbols (such as:?, @, etc.) + Binocular special symbols (eg: <=, ==, etc.) + character string ", etc., so the regular expression used to analyze, but the contents of single quotation marks (can be more than one character) which refers to one ah?

I may not want to thoughtful, but please correct me. 3Q ~
eliuxm
2010-01-29 03:58:33
just want to say this regular expression written very rubbish!
lblb921
2010-01-29 04:12:38
2 floor Avatar and I almost Oh, upstairs is an old fruit
s8485868788
2010-01-29 04:19:44
Reply fourth floor, you must have a good regex to match a valid code, right? coveted ing ...
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.