Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 521
  • Last Modified:

Finding consecutively repeating characters

I'm trying to find a regular expression that will find consecutively repeating characters of 3 or more.

example:  If the string is B000B it should find 000 but if the string is B0000B it should find the first 3 0's from B000 and the last 3 0's from 000B.
1 Solution
Marco GasiFreelancerCommented:
The pattern is


since the first character is captured by \1 and the other 2 by {2}

NevSoFlyAuthor Commented:
thanks for your reply.

The final pattern was actually (.)\1{2,}.  Thanks for the help.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now