summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-01-09 01:46:31 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-01-09 10:04:37 +0000
commite357fc671749d483a102a060a774d41a9b256b46 (patch)
treead6b6dd8c8d0407474c2ac0da73f6ccbcbcfdb47 /regcomp.c
parent850d607338c285d0f6a7d66f1c4baf08de921004 (diff)
downloadperl-e357fc671749d483a102a060a774d41a9b256b46.tar.gz
Let the regex parser decide if we have a special pattern or not.
Message-ID: <9b18b3110701081546n2c3f19acy29adc0d233bb848c@mail.gmail.com> p4raw-id: //depot/perl@29730
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 8772237205..c1c141a0ab 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4582,6 +4582,11 @@ reStudy:
r->paren_names = (HV*)SvREFCNT_inc(RExC_paren_names);
else
r->paren_names = NULL;
+ if (r->prelen == 3 && strEQ("\\s+", r->precomp))
+ r->extflags |= RXf_WHITE;
+ else if (r->prelen == 1 && r->precomp[0] == '^')
+ r->extflags |= RXf_START_ONLY;
+
#ifdef DEBUGGING
if (RExC_paren_names) {
ri->name_list_idx = add_data( pRExC_state, 1, "p" );