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
1418.Regular expression replace -- How to keep all lines with 6 letters or numbers and at most 2 letter?
User:
jiangnan -- 2018-07-20
<< 1417
1419 >>
Hits:
2165
Type:
Regular expression replace
Search all
Regular expression replace
examples
Description:
How to keep all lines match 6 chars with letter or number,and at most 2 letter?
Input Sample:
abc123
ab1234
ab12345
a1234b
1234ab
ab123
a12345
Output Sample:
ab1234
a1234b
1234ab
a12345
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open source file
2. ctrl-h open 'replace' dialog
* set 'replace unit' to 'Line'
* set 'if' to:
!matches($match, '^[0-9a-zA-Z]{6}$') || matches($match, '([a-zA-Z].*){3}')
3. click 'replace', done.
Screenshot 1: Replace_Window
Similar Examples:
How to remove all the lines that with odd line number for multiple files?
(60%)
How to re-group all lines in a file by a wordlist file?
(59%)
How to extract all lines with numbers from many text files?
(59%)
How to replace letters with predefined numbers in a text range?
(58%)
How to reverse all cases of letters in a text file?
(58%)
How to remove all lines that contain one or more words in a list?
(57%)
How to change all lines to columns in a text?
(56%)
How to change all negative numbers to the format of (number)?
(56%)
Check Demo of
Regular expression replace
Keywords:
matches
letters
keep
2 letter
letter
regular expression
numbers
expression
a z
chars
number matches
keep letters
keep numbers
keep lines
replace letters
keep number
replace letter
3 letter