| Author |
String Reading Problem
|
akhter wahab
Ranch Hand
Joined: Mar 02, 2009
Posts: 151
|
|
hey guys here is the code
i am not understanding what does actually "([A-Z\\d]{2}\\s+\\d+)" this string is doing please guide me to understand this
|
Start Earning Online||Start Earning Using Java
|
 |
Hunter McMillen
Ranch Hand
Joined: Mar 13, 2009
Posts: 490
|
|
This is a pretty good website on regex to provide you with some guidance:
http://www.regular-expressions.info/
As to your specific question, break it down into parts.
What does this part match?
Now what does this part match?
It's pretty confusing when you try to look at it as a whole, but when you break it down into parts it's much simpler. You can test your patterns for matches using the java.util.regex.Matcher class.
example:
Hunter
|
"If the facts don't fit the theory, get new facts" --Albert Einstein
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
|
The Java™ Tutorials section is another good resource about regular expression.
|
 |
john chris
Greenhorn
Joined: Aug 02, 2010
Posts: 8
|
|
you could read java.util.regex.Pattern.class
|
 |
akhter wahab
Ranch Hand
Joined: Mar 02, 2009
Posts: 151
|
|
i actually wants to know what
pattern.compile and abc.matcher do...
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Then check out the Javadoc of java.util.regex.Pattern.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
Akhter Wahab, somebody else has already referred you to that class. Did you read the links quoted earlier?
|
 |
akhter wahab
Ranch Hand
Joined: Mar 02, 2009
Posts: 151
|
|
Campbell Ritchie wrote:
Akhter Wahab, somebody else has already referred you to that class. Did you read the links quoted earlier?
sorry Campbell Ritchie i didn't... now i got it
thanks
|
 |
 |
|
|
subject: String Reading Problem
|
|
|