my original data is
id=A123 clientid:123456 SSLR
need to mask 123456
you can try this....
"s/clientid:(\d+)/clientid:xxxxxx/g" OUTPUT : id=A128 clientid:xxxxxx SSLR "s/clientid\:(\d+)\s\S+/xxxxxx/g" OUTPUT : id=A128 xxxxxx
The original data is captured in 3 groups. The first group ($1) has \"password\":\" the second group has the password and the third group has \". $1masked$2, basically means use whatever is captured in group 1 followed by "masked" followed by whatever is captured in group 3