Follow up on my own question:
If I use the following expression, I get the desired result:
RegularExpression re = new RegularExpression("^(\\w+)\\s*?=\\s*?(.*?)\\;$");
Why is it that using (.*?) twice is not producing the desired result ? Is this
a bug or a feature ?
TIA
Shishir
> -----Original Message-----
> From: Shishir K. Singh
> Sent: Monday, June 23, 2003 10:41 AM
> To: '[EMAIL PROTECTED]'
> Subject: org.apache.xerces.utils.regex help
>
> Hi,
>
>
> My intent is to parse the property file like
>
> AAAAAA = BBBBBBB;
> XXXXXX = "YYYYYY";
>
> I am using the following expression which works fine with the
> java.util.regex package Java 1.4 (I have to do the same on Java 1.3).
>
> RegularExpression re = new
> RegularExpression("^(.*?)\\s*?=\\s*?(.*?)\\;$");
> Match mat = new Match();
> boolean m = re.matches(line,md);
>
> I want to get to the two group to get the key/value pair.
>
> The return value of m is false.
>
> Is there something wrong with the expression ?
>
>
>
> TIA
> Shishir
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]