| View previous topic :: View next topic |
| Author |
Message |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sat Jul 08, 2006 6:53 am Post subject: regexp and its *maddening* ways of handling vars |
|
|
::rant::
Can someone explain why regexp will work with something like:
| Code: |
set mylameregexp "blah blah($somevarIwanttoGrep) blah"
regexp $mylameregexp $varIamGrepping match myvar
|
But WON'T work with:
| Code: |
regexp {blah blah ($somevarIwanttoGrep) blah} $varIamGrepping match myvar
|
yes I realize that the $ is supposed to indicate an end of line, but then, why does $mylameregexp work? Nevermind, I think I know the answer
Trying to set certain patterns in vars is itself an exercise in creative kludging...
::end rant:: |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jul 08, 2006 7:16 am Post subject: |
|
|
If you replace the braces ({}) with quotes ("") it will be the same. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sat Jul 08, 2006 11:24 pm Post subject: |
|
|
Good to know, thanks  |
|
| Back to top |
|
 |
|