Problem with RegEx syntax

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?

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:

"(\\w)\\1{3,}"

(You want to match a single character and then that character repeated three more times.)

Best regards,