Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#15 option for literal matching

open
nobody
None
5
2012-06-19
2012-06-19
Anonymous
No

Awesome tool!

For doing search-and-replace work on code, it would be lovely if I had a tick-box for kicking it into "literal" mode where all of the characters were escaped.

As an example, I am trying to replace
GetTxtFmt()->Count()
with
GetTxtFmt()->size()

But I have to add 5 or 6 slashes into that to make it work because so many of the characters are meaningful to regex engine.

Thanks.

Discussion

  • Daniel Elstner
    Daniel Elstner
    2012-06-19

    Although not exactly intuitive, you can do this quite easily in the Perl regex itself: Just start the regex with "\Q" to have the engine interpret everything that follows literally. (Well, everything except for "\E", which would end the quoting.)