Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regexp

Status
Not open for further replies.

bebig

Technical User
Oct 21, 2004
111
US
<schedule id="863"/>
===================

I am trying to do this...but I got error....how to write correctly
regexp {(\<schedule id=\")([0-9]*)\"\>} $lineS4 t1 t2 t3


thank you in advance
 
How's this?
Code:
() 61 set target {fo383jd89d83nj<schedule id="863"/>jjc83jdj}
() 62 regexp "\<schedule.*\[0-9\]+.*\>" $target foo
1
() 63 % set foo
<schedule id="863"/>
 
Thank you

if so,
in this case, I got syntax error.

regexp {(\<schedule id=\")([0-9]*)\"\>} $lineS4 t1 t2 t3

Based on this syntax, would you please tell me where I did mistake??



 
You are being overprecise with your regexp here.
Keep it simple. You also need to have regexp construe
your regexp as a string for best results, thus the
quotes rather than bracket notation.

Code:
() 81 regexp "(\<schedule.*=\).(\[0-9\]+).*\>" $target foo one two
1
() 83 set foo
<schedule id="863"/>
() 84 % set one
<schedule id=
() 85 % set two
863
(mars) 86 %

I do not try to escape quotation marks, though you can:
use the anychar '.', regexp symbol, it's good enough.
My 2 cents.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top