Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

497.Regular expression replace -- How to batch replace text that contains special characters like $,{,} ?

User: lio -- 2010-05-03          << 496  498 >>
Hits: 474
Type: Regular expression replace   
Search all Regular expression replace examples
Description:
replace like this below!~ batch replace!~
Input Sample:
select * from {$pre}members where ¡­¡­
Output Sample:
select * from my_members where ¡­¡­
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Three typical ways to use 'Replace Pioneer' to replace some special characters.

1. you just need to add a backslash before the character, like 
 

2. you can also quote the strings with backquote(`) that contains special characters like:

Note: this approach is not supported in 'Fast Replace' operation.

3. If your search and replace strings are all fixed strings, you can also uncheck 'Regular Expression' option to 'Replace' window, in that case, you do not need unescape all special chars

Let's use the 2nd approach as example:
1. ctrl-o open source text file
2. ctrl-h open replace window
* in 'serch for pattern' enter:

* in 'replace with pattern' enter:

3. click 'Replace', done!

Screenshot 1:  Replace_Window


Similar Examples:
How to batch replace lines that has less than 10 characters? (66%)
How to replace text containing some special symbols in a text file? (61%)
How to search and replace text for specified occurrences with reg exp? (58%)
How to search and replace text 'ReplaceMe' only in specified lines? (57%)
How to change a paragraph of text to a specical shape like a triangle? (55%)
How to batch rename files by removing all the letters and keep the rest? (54%)
How to extract all records that contains specified field values? (53%)
How to remove all lines that contain some specific strings in a text file? (53%)

Check Demo of Regular expression replace
Keywords:
serch  escape  cap  special characters  special character  quote  backslash  2nd  special  strings  serch replace  batch contains special characters  replace special character batch  batch contains character  batch special character  batch text special characters  batch special characters  batch replace special character