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:
289
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 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 find out all files that contain all words of A, B and C?
(54%)
How to find all lines in file A that contain words in file B?
(53%)
How to remove all the lines that do not contain any of words in a list?
(53%)
Check Demo of
Regular expression replace
Keywords:
letters that come after
password
pass
include
matches
letters
letter
after
regular expression
expression
replace the with in password
replace all text after
replace letters
after text
replace after
replace with pattern regular expression
how to replace some text in
change word