Extracting substring with regexp
- From: Alex <akizub@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 12:52:33 -0800 (PST)
How to extract substring with regexp when we have start and end for
substring?
For example I want to find what is between "abc" and "xyz" in the
String.
Pattern p = Pattern.compile("abc*xyz");
Matcher m = p.matcher("aaaaaaaaaabc123xyzzzzzzzzzzzzz");
but m.matches() returns false and can't find my patter.
How can I get these "123" in this example?
Alex Kizub.
.
- Follow-Ups:
- Re: Extracting substring with regexp
- From: Lord Zoltar
- Re: Extracting substring with regexp
- From: Eric Sosman
- Re: Extracting substring with regexp
- From: Lord Zoltar
- Re: Extracting substring with regexp
- Prev by Date: Null Pointer Exception when executing a Java software
- Next by Date: Re: Extracting substring with regexp
- Previous by thread: Null Pointer Exception when executing a Java software
- Next by thread: Re: Extracting substring with regexp
- Index(es):