I'm attempting to use the find() function to locate characters in a string that repeat 4 or more times.
I've tried "[(\\w)\\1{4,}]" but it complains of an "Illegal/unsupported escape sequence near index 6". Is there a problem with referencing subexpressions/groups? Any suggestions?
I've tried "[(\\w)\\1{4,}]" but it complains of an "Illegal/unsupported escape sequence near index 6". Is there a problem with referencing subexpressions/groups? Any suggestions?
-
Hi CodeMonkee,
I think that problem is in the square brackets, try to remove them. Btw. If you want four or more characters, you should use this:
(You want to match a single character and then that character repeated three more times.)"(\\w)\\1{3,}"
Best regards,
Please sign in to leave a comment.
Comments 1