wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes regex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "regex" Watch "regex" New topic
Author

regex

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


OUTPUT:

Match number 1
start(): 0
end(): 3
Match number 2
start(): 4
end(): 7
Match number 3
start(): 8
end(): 11

i don't understand how is it working

what i understand regx says match substring where "spacedogspace " i think there is only one match should be found at index 3.


My one regret in life is that I am not someone else.
- Woody Allen
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
Where do you think you're specifying the "space" before and after the word? Have you read the javadocs of the java.util.regex.Pattern class to learn what all the regexp options and special characters mean?


Ping & DNS - my free Android networking tools app
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Ulf Dittmer wrote:Where do you think you're specifying the "space" before and after the word? Have you read the javadocs of the java.util.regex.Pattern class to learn what all the regexp options and special characters mean?


Thanks, there was some confusion ,after reading i got that i thought \\b is for escape sequence backspace.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regex
 
Similar Threads
Regex question
Pattern Matching
replacement through regex
Please help me check this regex
Hot to deal with OutOfMemoryError