I need to look for java regex pattern that finds input string in the format of 1=1 where prefix of "=" should have same count of digits with the suffix. Also here both prefix & suffix values should be the same like 1=1, 11=11, 223=223. Values like 1=2, 3=22, 33=22 should not match the pattern
Can we have a general pattern to satisfy above rules.
Use a back reference:
(\d+)=\1\b
of course, in java you need to escape the back slashes:
"(\\d+)=\\1\\b"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments