Reputation: 667
In my case I want to capture a group of strings that contain a specific number of consecutive characters.
I know I can find that by writing something like:
/('characterHere')\1\1\1\1.../ <- as many times as I want the consecutive string to have the character
which works fine, I can find that string of the consecutive characters in my strings.
My question is once I find a string with that consecutive character I am interested in how can I grab the entire string regardless of the rest of its contents?
ex) Sample strings:
xxxxxxxxyyyxxxx
xxxxxyyyxxxxxx
xyxyxyxyyyxxxx
Notice those three strings had three consecutive y's regardless of the rest of the string.
So:
/(y)\1\1/ can find the three y's in a row,
but I cant grab the entire string (which is what I want).
Upvotes: 0
Views: 66