aspose file tools*
The moose likes Beginning Java and the fly likes String Reading Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String Reading Problem" Watch "String Reading Problem" New topic
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: 492

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: 36579
    
  16
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: 19556
    
  16

Then check out the Javadoc of java.util.regex.Pattern.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
Rob Prime wrote:Then check out the Javadoc of java.util.regex.Pattern.
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:
Rob Prime wrote:Then check out the Javadoc of java.util.regex.Pattern.
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Reading Problem
 
Similar Threads
a question on thread flow
Chapter 5 K&B -Doubt
Why doesn't my regex pickup this line
JSP not working with Windows 7
Splitting a String into an array using split()