Remove before a character (| is used in example):
Find: .+(\|)
Replace: \1
Remove everything between brackets
Fine: <.*?>
Replace:
New line after a character ( ] is used in example):
Find:]\s*
Replace: ]\n
Remove before a character ( < is used in example):
Find: ^[^>]*<
Replace: \1
1 2 3 4 |
[crayon-62f21f6ac0935889460690 inline="true" ]^ : beginning of line [^>] : 1 or more any character that is not a > [^>]* : 1 or more any character that is not a semicolon and everything after [^>]+< : 1 or more any character that is not a > and remove < |
[/crayon]
Remove after a character ( @ is used in example)
Find: [^@]*$
Replace: \1
Remove after a character ( X is used in example)
Find: \X.*
Replace: \1
Add after each line
Find: $
Replace: text to add at end of each line
– RegEX, Place cursor in begging
Add before each line
Find: ^
Replace: text to add at before of each line
– RegEX, Place cursor in begging
Remove string between start and end of a chr.
Find: (?<=CN\=).*?(?=\OU=)
Replace: CN start and OU=
– RegEX, Place cursor in begging
^cn.+?\ou
– RegEX, Place cursor in begging
1 |
[crayon-62f21f6ac093d967436955 inline="true" ](?s)^\t*File created by(.|\r\n)*?Message log |
[/crayon]
Notes :
- At beginning of the regex, the modifiers
(?s-i) mean that :
- The . dot regex character will match any single character ( Standard and EOL chars )
- The search is performed in a sensitive way. If you prefer insensitive matches just change that part with (?si) !
- Then the part File created by.+?\RMessage log looks, from beginning ( ^ ) of line, for any text, beginning with File created by and ending at the first expression Message log, preceded by a line-break ( \R )
- Now, the final part .*?$\R tries to match a range of any character, ending at the nearest end of line ( $ ), and followed with a line-break ( \R )
And, due to the empty replacement zone, all that block of text is, then, simply deleted !
1 |