Difference between revisions of "Remove everything after a specific character"
From Tech-Wiki
Line 11: | Line 11: | ||
* Leave the '''Replace with :''' string blank | * Leave the '''Replace with :''' string blank | ||
* Press '''Replace''' or '''Replace All''' | * Press '''Replace''' or '''Replace All''' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | [[Category:Notepad++]] | ||
+ | '''[[Notepad ++#Useful Tips|Back to Useful Tips]]''' | ||
+ | |||
+ | * In an open document | ||
+ | * press '''Ctrl-H''' | ||
+ | * Set the search Mode to '''Regular expression''' | ||
+ | * In '''Find what:''' string write the following regex pattern | ||
+ | |||
+ | '''\<Charachter to find>.+''' | ||
+ | |||
+ | * Leave the '''Replace with :''' string blank | ||
+ | * Press '''Replace''' or '''Replace All''' | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | '''Explanation of Regular Expression''' | ||
+ | |||
+ | \ General escape character | ||
+ | . Any character | ||
+ | + One or more the previous character |
Revision as of 05:04, 20 July 2016
- In an open document
- press Ctrl-H
- Set the search Mode to Regular expression
- In Find what: string write the following regex pattern
\<Charachter to find>.+
- Leave the Replace with : string blank
- Press Replace or Replace All
- In an open document
- press Ctrl-H
- Set the search Mode to Regular expression
- In Find what: string write the following regex pattern
\<Charachter to find>.+
- Leave the Replace with : string blank
- Press Replace or Replace All
Explanation of Regular Expression
\ General escape character . Any character + One or more the previous character