prasadbabu has asked for the wisdom of the Perl Monks concerning the following question:
Monks, today i was preparing question for beginners in regex. So to tell them, that we can use any delimiters for regex as per the documentation perlre, i chose the below question.
$str = 'abc.'; $str =~ s.\...; print $str;
Very well I know that its not good using the delimiters like '.' etc. Before taking the question i tested this and found the odd answer. I expected 'abc' but i got 'bc.'. Where am i going wrong? I came with this question in CB and i was sent here. :-)
Thanks in advance
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex - Delimiter question
by Hofmator (Curate) on Sep 29, 2006 at 14:30 UTC | |
|
Re: Regex - Delimiter question
by cephas (Pilgrim) on Sep 29, 2006 at 14:26 UTC | |
|
Re: Regex - Delimiter question
by GrandFather (Saint) on Sep 29, 2006 at 18:46 UTC | |
by Smaug (Pilgrim) on Sep 30, 2006 at 07:43 UTC | |
|
Re: Regex - Delimiter question
by Khen1950fx (Canon) on Sep 30, 2006 at 02:36 UTC | |
|
Re: Regex - Delimiter question
by wfsp (Abbot) on Sep 29, 2006 at 14:42 UTC | |
|
Re: Regex - Delimiter question
by Solo (Deacon) on Sep 29, 2006 at 14:39 UTC |