I want to replace each char after 'to' with * using regex in Java.
Input:
String str = "thisisstringtoreplace"
Expected output:
thisisstringto*******
I am using
Pattern.compile("(?<=password=).*$")
This pattern replace all char with 1 *
, I want *
of remaining sting size (7 in this case). The action I want to perform is part of framework so I just need a regex for this.