Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Programmer Certification (OCPJP)
regex problem
joshua antony
Ranch Hand
Posts: 117
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Pattern p = Pattern.compile( "\\d*" ); Matcher m = p.matcher( "ab34ef" ); boolean b = false; while( b = m.find()) { System.out.print( m.start()); // + m.group()); }
The output is 012456. Where does this 6 come from. I thought the output should be 012345. m.start() for f is 5; so from where did 6 come?
Gowher Naik
Ranch Hand
Posts: 643
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Your question is discussed Here
joshua antony
Ranch Hand
Posts: 117
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you,
That was really helpful.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Regex Question
problem in Regex>>
chapter 6, self test q2
Regex Problem from Kathy & Sierra Book
a regex question from the B SCJP 6 book
More...