You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by Srinivasan Krishnan <sr...@wipro.com> on 2002/08/18 13:41:33 UTC

RE: help on framing regular expression

Hi,
Greetings

I am trying to use nested expression parsing.

When I follow the example given in
http://javaregex.com/cgi-bin/pat/tutorial6.asp used in ORO it gives

Sequence (?@...) not recognized exception..Any idea about the support in
ORO.


Here the text is

String text = "a=7; foo( x=2+4, bar(9) ); output(8);";

Regular expression is

String regexpForFontTag="foo(?@())";

Regards,
Srini sk



-----Original Message-----
From: Steven R Brandt [mailto:sbrandt@javaregex.com] 
Sent: Saturday, August 17, 2002 7:01 AM
To: Srinivasan Krishnan
Subject: Re: help on framing regular expression


I think the pattern element

    (?@<>)

Should do what you want.  It was designed for matching nested
parenthesis. See http://javaregex.com/cgi-bin/pat/tutorial6.asp

Cheers,
Steve

8/16/02 3:03:21 PM, "Srinivasan Krishnan"
<sr...@wipro.com> wrote:

>
>
>  From:   "Srinivasan Krishnan" <sr...@wipro.com>
>
>  To:     <qu...@javaregex.com>
>  Subject:help on framing regular expression
>  Date:   Sat, 17 Aug 2002 00:33:21 +0530
>
>
>
>   
>  grettings
>   
>  i am using the RegExp in JAVA for the some tricky find and replace
>   
>   
>  My intention is to split the HTML attributes and work on it 
> individually
>   
>  for example
>   
>  <img key = value key1= value1 key2= value2 >
>
>   
>  is a string i get i want to separate  keys and values
>  like
>   
>  key = value
>  key1 = value1
>  key2 = value 2
>   
>  This works by using below expression
>   
>  "<img\\s*([^>]*)\\s*>" is my Regex in java  ..  ( you will find a 
> extra / in  java when u compare PERL expression )
>
>   
>  it works fine in parsing <img src="test" value =10> and spearates
>   
>  src = "test"
>  value = 10.
>   
>   
>  Problem is when one of my value has my delimter >
>   
>  for example if my string to be checked is <img src=<%=Value%> 
> value=10>
>
>   
>  if fails ( because it has seen a > in  src=<%=Value%>  ) . But i want

> the  parsing to stop only in the final >
>   
>   
>  Can you pelase Help me  in replacing [^>]* such away that it allows 
> %> and  stops only in >
>   
>   
>  WIPRO,Shollinganallur, Chennai
>
>  (Office)  044-4500200 Extn: 2444
>  (Residence) 044-4958790
>  Email:- srinivasan.krishnan@wipro.com
>   
>