PDA

Click to See Complete Forum and Search --> : RegEx Sytax


john tindell
Feb 21st, 2005, 04:36 PM
Hey im trying to create a Regex expression to match text.
I want to match

{unknow text here}

and

(*unknow text here*)


If anyone can point me in the right direction, i know about expressions from PHP but it doesnt seem to work.

Thanks

mendhak
Feb 22nd, 2005, 05:31 AM
\{(.)*\}

and

\{(\*){1}(.)*(\*){1}\}

john tindell
Feb 22nd, 2005, 06:59 AM
Cheers, is there a way to make it work for multilines? Adding the RegexOptions.Multiline flag didnt seem to have an effect.

Thanks

mendhak
Feb 22nd, 2005, 07:25 AM
Not sure about this one.

Try one of these:


^\{(.)*\}$

and

^\{(\*){1}(.)*(\*){1}\}$

OR

\A\{(.)*\}\Z

and

\A\{(\*){1}(.)*(\*){1}\}\Z

john tindell
Feb 22nd, 2005, 07:31 AM
I found

[(*]\S*([^"">]+?)\S*[*)]\S*[)]

[{]\S*([^"">]+?)\S*[}]|{.*?}

which seem to work for multi line, but not single line.

Cheers

nemaroller
Feb 22nd, 2005, 11:36 AM
I think what you're looking for is something along these lines:


(.)(.)
| |
( )
""
[|||]