S
SL
Hi,
I want to capture several substrings of a string: I want each occurrence of
"/" (a syllabus boundary), with the character until the next "V" and the
previous "V" included.
For instance, for this string :
$string="OF/LOV/FOGVOTO/LFO";
I want this substrings :
#OF/LOV (from beginnig to first "V" after the first "/")
#V/FOGV (from the first "V" before to the first "V" after)
#V/OTO/LFO (from the first "V" before the end)
I try this :
@syl_boundaries = ($string =~ m|(V?[^V]*/[^V]*V?)|g);
But it returns :
OF/LOV
/FOGV
OTO/LFO
instead, as if the same character may not be captured twice. Any advice
would be very helpful!
Many thanks,
SL
I want to capture several substrings of a string: I want each occurrence of
"/" (a syllabus boundary), with the character until the next "V" and the
previous "V" included.
For instance, for this string :
$string="OF/LOV/FOGVOTO/LFO";
I want this substrings :
#OF/LOV (from beginnig to first "V" after the first "/")
#V/FOGV (from the first "V" before to the first "V" after)
#V/OTO/LFO (from the first "V" before the end)
I try this :
@syl_boundaries = ($string =~ m|(V?[^V]*/[^V]*V?)|g);
But it returns :
OF/LOV
/FOGV
OTO/LFO
instead, as if the same character may not be captured twice. Any advice
would be very helpful!
Many thanks,
SL