How do i replace tagged expression on OR conditional search
Posted: Thu Jan 15, 2009 8:08 pm
Hi,
I am trying to find and replace following comma(,) and rest of the line on following three situation of select query and i got struck at the replacement speicification.
1) Line ended with comma(,)
Example: a.column3,
2) Line ended with spaces( ) after comma(,)
Example: a.column,\space\space\space
3) Line ended with comments(--some text spaces) after comma
Example: a.column2, -- comment,
Now i want above three scenarios to be replaced with text just before that comma(,) character.
I could able to find all of them with the following find specification.
Find What: ^\(.*\),[ ]*$\|^\(.*\),[[:blank:]]*--*.*$
Replace with: \1\2
This didn't work well when it finds the string by first expression itself.
I could do this in two search, but i would prefer to do it in single search itself.Please advise me on this....
Thanks
Thamark
I am trying to find and replace following comma(,) and rest of the line on following three situation of select query and i got struck at the replacement speicification.
1) Line ended with comma(,)
Example: a.column3,
2) Line ended with spaces( ) after comma(,)
Example: a.column,\space\space\space
3) Line ended with comments(--some text spaces) after comma
Example: a.column2, -- comment,
Now i want above three scenarios to be replaced with text just before that comma(,) character.
I could able to find all of them with the following find specification.
Find What: ^\(.*\),[ ]*$\|^\(.*\),[[:blank:]]*--*.*$
Replace with: \1\2
This didn't work well when it finds the string by first expression itself.
I could do this in two search, but i would prefer to do it in single search itself.Please advise me on this....
Thanks
Thamark