| User: editor -- 2011-10-07 << 866 868 >> |
| Hits: 202 |
| Type: Regular expression replace |
| Search all Regular expression replace examples |
| Description: |
| How to keep all specified words in an article and remove rest words? |
| Input Sample: |
| ..... word1 ...... verb1 ...... word2 .... .... word2 ...... verb2 ...... word3 ..... .... word2 ...... verb3 ..... word4 .... .... word2 ...... verb4 ....... word5 |
| Output Sample: |
| word1 verb1 word2 word2 verb2 word3 word2 verb3 word4 word2 verb4 word5 |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| 1. ctrl-o open text file 2. ctrl-h open 'replace' dialog * set 'search for pattern' to: * set 'replace with pattern' to: * uncheck option of 'print unmatched units' 3. click 'replace', done. 4. ctrl-s save to file. |
Screenshot 1: Replace_Window |
Similar Examples: |
| How to search specified pattern in a text file and remove spaces in it? (63%) How to replace one specified word with a sequence of words from a file? (60%) How to replace all specified symbols with dot in specified range? (58%) How to replace words in a text file only if they are whole words? (57%) How to replace the same words in text files with different strings? (55%) How to extract all specified links from a html file? (55%) How to remove some specified characters from multiple filenames? (54%) How to extract all specified date format from a text file? (54%) |
Check Demo of Regular expression replace |
| Keywords: |
| verb keep unmatched unmatch regular expression expression print regular regula words keep words remove specified remove words search text file with words in text file remove all remove all text search words words to replace |