Re: Regex Question

2012-08-18 Thread Frank Koshti
I think the point was missed. I don't want to use an XML parser. The point is to pick up those tokens, and yes I've done my share of RTFM. This is what I've come up with: '\$\w*\(?.*?\)' Which doesn't work well on the above example, which is partly why I reached out to the group. Can anyone help

Re: Regex Question

2012-08-18 Thread Frank Koshti
Hey Steven, Thank you for the detailed (and well-written) tutorial on this very issue. I actually learned a few things! Though, I still have unresolved questions. The reason I don't want to use an XML parser is because the tokens are not always placed in HTML, and even in HTML, they may appear

Re: Regex Question

2012-08-18 Thread Frank Koshti
On Aug 18, 11:48 am, Peter Otten __pete...@web.de wrote: Frank Koshti wrote: I need to match, process and replace $foo(x=3), knowing that (x=3) is optional, and the token might appear simply as $foo. To do this, I decided to use: re.compile('\$\w*\(?.*?\)').findall(mystring

Re: Regex Question

2012-08-18 Thread Frank Koshti
On Aug 18, 12:22 pm, Jussi Piitulainen jpiit...@ling.helsinki.fi wrote: Frank Koshti writes: not always placed in HTML, and even in HTML, they may appear in strange places, such as h1 $foo(x=3)Hello/h1. My specific issue is I need to match, process and replace $foo(x=3), knowing that (x=3

Regex Question

2012-08-17 Thread Frank Koshti
Hi, I'm new to regular expressions. I want to be able to match for tokens with all their properties in the following examples. I would appreciate some direction on how to proceed. h1@foo1/h1 p@foo2()/p p@foo3(anything could go here)/p Thanks- Frank --