D
Dominic van der Zypen
Hello!
I'd like to do the following:
Given just one line of text, match every occurrence of a double letter
and push those double letters on @my_stack. Say, if we are given
$line = "This line contains some occurrences of double letters,
hoorray";
then I want @my_stack to end up containing "cc", "rr", "tt", "oo",
"rr";
Everything I tried so far just put the first occurrence of double
letters (in this example, "cc") on the stack, even if I used the /g
option for my match. I suppose the regex engine matched every
occurrence, but somehow it didnt "halt" and "care to push" every single
one of the on @my_stack.
So... how should I go about the above problem?
Many thanks for your help!! Dominic
I'd like to do the following:
Given just one line of text, match every occurrence of a double letter
and push those double letters on @my_stack. Say, if we are given
$line = "This line contains some occurrences of double letters,
hoorray";
then I want @my_stack to end up containing "cc", "rr", "tt", "oo",
"rr";
Everything I tried so far just put the first occurrence of double
letters (in this example, "cc") on the stack, even if I used the /g
option for my match. I suppose the regex engine matched every
occurrence, but somehow it didnt "halt" and "care to push" every single
one of the on @my_stack.
So... how should I go about the above problem?
Many thanks for your help!! Dominic