Hi Dave -
Thanks, I'll give an easier example, say I have:
sodium ion test
and I search for "sodium ion test", matching, tagging, I end up with, say
TEST${sodium ion test}
now if I go to search for just "ion", i don't want it to match because "ion"
is now within curly braces.
using [^{].+ion.+[^}] produces a match, which i don't want. If i put spaces
in the regex like so, [^{] .+ ion .+ [^}], then it doesn't match, but also
doesn't match simply "sodium ion test"
Basically, if I'm searching for "ion" here's the truth table I want to end
up with:
string match?
TEST${sodium ion test} no
sodium ion test yes
TEST${sodium} ion test yes
TEST${sodium} ion TEST${test} yes
Again, thanks in advance for any suggestions!
Derrick
-----------------------------------------------------------------------
Your example seems fine. Is there a reason it's not working for you? What
is the side effect?
--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"Derrick" <de*********@ex cite.com> wrote in message
news:eM******** ******@TK2MSFTN GP15.phx.gbl...
I am attempting to perform some word/phrase tagging, using regular
expressions.
I have the simple case working, looking for the string "one two three" in
the string "one two three four three two one"
My code is then tagging the match and surrounding it with braces, so I would end up with
"$MATCH1{on e two three} four three two one"
Down the line I wind up searching for the single word, "two", but do not
want to match the first occurence which is enclosed within curly braces.
Can anyone help me with the expression to match the second "two" in the
above string, but not the first, which is enclosed within curly braces, but does not necessarily have the enclosing curly braces right next to the
string you are searching for?
The farthest I could get was something along the lines of
[^{] .+ two .+ [^}]
?
Thanks a bunch in advance!
Derrick