Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?=(?:\d|(?<=\d)[_\W]\d){4,5})\d|(?<=(?<!^)\G)\d|(?<=\d)[_\W]\d
/
gm
Input 1
New
any text 000 00 more texts" will become "any text ***** more texts"..notice that the space is removed "any text 000 00 more texts 00" will become "any text ***** more texts 00" "any text 000 00 more texts 00 00" will become "any text ***** more texts ****" "any text 00-00 more texts 00_00" will become "any text **** more texts ****"
Extraction
any text 000 00 more texts" will become "any text ***** more texts"..notice that the space is removed "any text 000 00 more texts 00" will become "any text ***** more texts 00" "any text 000 00 more texts 00 00" will become "any text ***** more texts ****" "any text 00-00 more texts 00_00" will become "any text **** more texts ****"