The stupid question is the question not asked | |
PerlMonks |
regex : finding the location multiple clustered (in parenthesis) groupsby yonatan (Novice) |
on Aug 02, 2010 at 09:47 UTC ( [id://852440]=perlquestion: print w/replies, xml ) | Need Help?? |
yonatan has asked for the wisdom of the Perl Monks concerning the following question:
hello monks,
i wish to match the "neither-nor" couples in the following text sample:
suggested matching pattern is: (\bneither\b)[^.?!;]*?(\bnor\b)i want to get the location of BOTH the first (\bneither\b) and its following (\bnor\b). the location information may be similar to that returned by pos(), i.e. the following character position when //g is in use. my questions: 1. is there an elegant way to return the position of single parenthesized group? 2. -"- the position of each group out of multiple groups? thank you!
Back to
Seekers of Perl Wisdom
|
|