Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

224.Advanced search and replace -- How to remove/delete all text enclosed by a pair of square bracket []?

User: editor -- 2008-07-15          << 223  225 >>
Hits: 3072
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to remove all text enclosed by a pair of square bracket []?
Input Sample:
sentence1[comments1] 
sentence2[comments2] 
...
Output Sample:
sentence1 
sentence2 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open the text file 
2. ctrl-h open 'Replace' dialog 
in 'Replace' page: 
* set 'Search for pattern' to: 
 
* set 'Replace with pattern' to nothing 
3. Click 'Replace', done! 
 
Note:  
\[.*?\] is a regular expression, will match any characters enclosed by a pair of square bracket. 
Download Script:  scripts/224.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to batch remove all the text that enclosed by a pair of parenthesis? (67%)
How to remove/delete the text from the '#' to the end in each line? (61%)
How to remove/delete all lines with even line number? (60%)
How to remove/delete all lines with even line number? (60%)
How to remove all lines whose 4th column enclosed by a pair of parenthesis? (59%)
How to remove/delete all text between '1:' and 'user:'? (58%)
How to move text before first square bracket to the replace of the parenthesis? (56%)
How to extract all text enclosed by H1 tag from multiple html files? (56%)

Check Demo of Advanced search and replace
Keywords:
square  bracket  enclose  delete all text  delete all  characters  delete  delet  dele  remove all text  remove bracket  replace enclosed expression  enclosed replace regular expression  regular expression replace enclosed  enclosed text search and replace  match all characters  remove text with regular expression  remove characters