PDA

View Full Version : Ignore constant string


jmarinis
25-Sep-2008, 11:29 AM
I have two files that contain SQL. They are nearly identical other than the fact that one has _TST appended to all of its table names. I would like to ignore any lines where the only difference is _TST. I tried replacements, but I couldn't replace _TST with nothing. Someone else requested this, but there example could be worked around by using a regular expression. I wasn't able to accomplish my goal that way, but regular expressions are not something I have much experience with.

Is there a way to ignore a particular constant during a comparison?

Craig
25-Sep-2008, 11:32 AM
You can do that by matching the entire table name instead of just the _TST part. So if the _TST file is on the left:

Text to find: (\w+)_TST
Replace with: $1
[x] Regular expression

If it's on the right you could find (\w+) and replace it with $1_TST

jmarinis
25-Sep-2008, 11:49 AM
That works like a charm. Thank you.