Re: Pattern extracting
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Thu, 23 Mar 2006 17:55:37 GMT
"Hendrik Maryns" <hendrik_maryns@xxxxxxxxxxxxx> wrote in message news:dvu503$2pt$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----BEGIN PGP SIGNED MESSAGE-----[...]
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
Joni schreef:Hello
I have a string which has this format
[TagName "Value"]
Pattern tagPattern = Pattern.compile("\[(\S*)\s+\"(.*)\"\]");
// you can replace \s+ by ' ' if you're sure it is exactly one space.
// be careful when replacing \S*, if you use .*, you'll probably need a
// non-greedy quantifier.
What about the second .* that appears between the double-quote marks? Shouldn't that be non-greedy as well (or replaced with \S* as well)?
- Oliver
.
- Follow-Ups:
- Re: Pattern extracting
- From: Hendrik Maryns
- Re: Pattern extracting
- References:
- Pattern extracting
- From: Joni
- Re: Pattern extracting
- From: Hendrik Maryns
- Pattern extracting
- Prev by Date: Re: New To Java , I'm Stuck , Please Help!
- Next by Date: Re: how to make java application executable (exe)
- Previous by thread: Re: Pattern extracting
- Next by thread: Re: Pattern extracting
- Index(es):