I needed to match find a string within multiple text files. I used this expression to do it. The line started with stringtomatch, but you could change to search within a line by prefixing .*
^stringtomatch.*$
^ – caret matches start of line
$ – dollar matches end of line
stringtomatch - string to match at the start of the line, if its in the middle you could prefix .* (i.e .*stringtomatch.* )
.* - matches any characters

No comments:
Post a Comment