Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
need a regular expression for extracting strings.
john sal
Ranch Hand
Posts: 94
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am not very familiar with the regular expression in
java
...
I want to get all the
string
tokens froma an expression eg.
from exression (abc+def)/abc then what will be the regular expression that returns only stings from the expression say
abc def abc ?
Rob Spoor
Sheriff
Posts: 22783
131
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Have you already read the Javadoc page of java.util.regex.Pattern?
Basically the solution is pretty simple:
final String regex = ... // fill this in yourself ;) Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(input); while (matcher.find()) { System.out.println(matcher.group()); }
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Problem in regular expression for matching
Regular Expression
problem in writing Regular Expression
regular expression to Remove field inside [ ] brackets
Pathname Validation - Please help out!!!
More...