Re: Extracting substring with regexp
- From: Alex <akizub@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 13:29:45 -0800 (PST)
On Jan 31, 4:09 pm, Eric Sosman <Eric.Sos...@xxxxxxx> wrote:
Eric:
Thanks a lot. You are right.
But here is mismatch in my knowledge again:
I assume that this
Pattern p = Pattern.compile("abc(.*)xyz");
Matcher m = p.matcher("xxxxxabc123xyz789xyzxxxxx");
if (m.find())System.out.println(m.group(1));
should print "123" but, instead, it prints "123xyz789".
How can I force regexp to find first match?
I agree that I should read the Sun documentation. And, trust me, I
did...
Thanks in advance.
Alex Kizub.
.
- Follow-Ups:
- Re: Extracting substring with regexp
- From: Joshua Cranmer
- Re: Extracting substring with regexp
- References:
- Extracting substring with regexp
- From: Alex
- Re: Extracting substring with regexp
- From: Eric Sosman
- Extracting substring with regexp
- Prev by Date: Re: Extracting substring with regexp
- Next by Date: Re: Extracting substring with regexp
- Previous by thread: Re: Extracting substring with regexp
- Next by thread: Re: Extracting substring with regexp
- Index(es):