Hi All
I'm just starting to learn regular expressions using perl and am trying to write one to replace update statements in a text file using perl. The following seems to work fine:-
UPDATE (.+) SET (.+) =(.+).WHERE (.+) = (.+)
It allows me the back reference the table and column elements of the statements.
However I am aware from reading several tutorials that .+ is bad form as it is greedy and is open to unitended matches e.g. if another <SPACE>SET appeared in 1 line. The tutorials recommend using more precise mathces rather than using the DOT.
How can I do that in this instance?
Many Thanks
Spangeman
I'm just starting to learn regular expressions using perl and am trying to write one to replace update statements in a text file using perl. The following seems to work fine:-
UPDATE (.+) SET (.+) =(.+).WHERE (.+) = (.+)
It allows me the back reference the table and column elements of the statements.
However I am aware from reading several tutorials that .+ is bad form as it is greedy and is open to unitended matches e.g. if another <SPACE>SET appeared in 1 line. The tutorials recommend using more precise mathces rather than using the DOT.
How can I do that in this instance?
Many Thanks
Spangeman