Hey all,
I'm trying to work out a regular expression for a search (and replace) that will only locate an exclamation point if it lies outside of any open and close double quote sections on the line the cursor begins its positioning on. I want the cursor to end up in front of the last exclamation point in the line that doesn't reside between a set of quotes. In other words here's what would and wouldn't be a match:
string1="This is a string!" //no match
string2=("This string is " + "concatenated!") //no match
if ("This new string" != "The old string") then //matches
string3="Here's yet another string." !! And a comment about it. //matches
What I've been trying is several modifications of the following to find just exclamation points on the line with no quotes after them at all:
UnixReOn
Key HOME
IfColNumGt 1
Key HOME
Find RegExp Select "![^"]+$"
but this likely isn't the way to go and has been selecting the entire line anyway. It's almost like I'll have to strip the line of any open/close quote sections and then search for any remaining exclamation points but I hate to have to resort to opening a new file just for string manipulation since this macro will likely be tied to a larger macro that will search the entire file.
Any ideas?
Thanks,
Jeff
I'm trying to work out a regular expression for a search (and replace) that will only locate an exclamation point if it lies outside of any open and close double quote sections on the line the cursor begins its positioning on. I want the cursor to end up in front of the last exclamation point in the line that doesn't reside between a set of quotes. In other words here's what would and wouldn't be a match:
string1="This is a string!" //no match
string2=("This string is " + "concatenated!") //no match
if ("This new string" != "The old string") then //matches
string3="Here's yet another string." !! And a comment about it. //matches
What I've been trying is several modifications of the following to find just exclamation points on the line with no quotes after them at all:
UnixReOn
Key HOME
IfColNumGt 1
Key HOME
Find RegExp Select "![^"]+$"
but this likely isn't the way to go and has been selecting the entire line anyway. It's almost like I'll have to strip the line of any open/close quote sections and then search for any remaining exclamation points but I hate to have to resort to opening a new file just for string manipulation since this macro will likely be tied to a larger macro that will search the entire file.
Any ideas?
Thanks,
Jeff