Re: Expression Help



I think both in sed and perl you can use any symbols you wish to delineate
the RegEx. # works, but / is traditionally used in Perl.
That is to say, in Perl these two lines are the same:

$in =~ s/C:\\Dir 1\\Dir 2\\Dir with more spaces/replacement/;
$in =~ s#C:\\Dir 1\\Dir 2\\Dir with more spaces#replacement#;

And, yeah, there ought to be a trailing i to make it case insensitive.


Relevant Pages

  • Re: matching a pattern with a space or no space??
    ... Perl doesn't have that function. ... How can I regex a data flow that is always ... surrounded by optional white space. ... next name and assignment. ...
    (comp.lang.perl.misc)
  • Re: Regexp slowdown
    ... with the same weak logic that you use for the regex stuff. ... cr> What of that makes you think I'm worried about the syntax of my regex? ... cr> memory-intensive attempt at interpreter optimization by the perl folks. ... cr> had a mile-long stack frame I would see a performance hit. ...
    (comp.lang.perl.misc)
  • Re: reg exp
    ... > looked in my learning perl and programming perl books and did not find this ... and "the thing" behaved as a regex should... ... which sums up the number read into $total. ... > Derek B. Smith ...
    (perl.beginners)
  • Re: Tough (for me) regex case
    ... worry about the paired doublequote case) I get a pattern which reads: ... In Perl, the quotes get consumed before the match is constructed. ... Then the regex matches include the quote characters, ...
    (microsoft.public.dotnet.framework)
  • Re: Tough (for me) regex case
    ... worry about the paired doublequote case) I get a pattern which reads: ... In Perl, the quotes get consumed before the match is constructed. ... Then the regex matches include the quote characters, ...
    (comp.lang.perl.misc)