Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
568.Regular expression replace -- How to change all letters that come after the word "password:" to ***** ?
User:
editor -- 2010-07-19
<< 567
569 >>
Hits:
3313
Type:
Regular expression replace
Search all
Regular expression replace
examples
Description:
How to change all letters that come after the word "password:" to ***** ?
I have some log files that has password included, how to replace the with *?
Input Sample:
......
......username: user1
... password: abcdefg
......
Output Sample:
......
......username: user1
... password: *******
......
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open replace window
* in 'search for pattern', enter:
(?<=password: )\S+
* in 'replace with pattern', enter:
replace($match,'.','*')
3. click "Replace", done!
Note: regular expression (?<=password: )\S+ matches letters that preceded by "password: "
Screenshot 1: Replace_Window
Similar Examples:
How to change all files that contains words "RRR" to read-only?
(61%)
How to change all the letters in a text file to upper cases?
(60%)
How to change first letter of every word to uppercase in first line?
(57%)
How to remove all line breaks that come after the backslash?
(57%)
How to remove all lines that are not ended with word "ok" or "done"?
(56%)
How to remove all lines that contain one or more words in a list?
(55%)
How to extract all lines that contain words A and B and C?
(55%)
How to extract all lines that contain specified words or phrases?
(54%)
Check Demo of
Regular expression replace
Keywords:
letters that come after
password
pass
matches
include
letters
letter
after
regular expression
ass
replace the with in password
regular expression replace all after word
regular expression replace some text
after word
replace all text after
replace letters
replace text after
after text