Re: [PHP] completely stumped by ereg()

sophie_at_sitadelle.com
Date: 11/30/03


Date: Sun, 30 Nov 2003 01:07:16 +0100 (CET)
To: <php-general@lists.php.net>

You should try

var_dump(ereg('C:\\\\W', 'C:\\WINNT\\TEMP\tst5B.tmp'));

The reason is that in simple quotes, antislashes don't have to be
escaped. Still, they need to be escaped in a regular epr ie in the first
argument of ereg() (the first and the secon argument are both string,
but in the reakity they are not really the same type)

> Why doesn't this match?
>
> var_dump(ereg('C:\\\\W', 'C:\\\\WINNT\\\\TEMP\\tst5B.tmp'));
>
> should print int(1), prints bool(false)
>
> Thanks,
> Greg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



Relevant Pages

  • Re: "I hate my Mac! I wanted to take it back its so hard to use!"
    ... Not as big as a reason as their complete lack ... How does the existence of iWork preclude anyone from using ... Office if that's what the "workplace" demands. ... meant without having to resort to quotes. ...
    (comp.sys.mac.advocacy)
  • Re: Will Rich ever learn how to properly cite a quote???Re: Jen Larson quotes.
    ... reason you changed them. ... quotes into Google and verify as copy & pasting one of your old ID's. ... to me how YOU use message IDs to verify a quote? ...
    (soc.men)
  • Re: Revolving door at CAA hits Savage in the butt.
    ... David Friedman wrote: ... I'm curious--do you have any reason to believe he actually said that, ... "attributed" can be found are more suspect than quotes supported by ... so you can trust books as sources either. ...
    (rec.arts.sf.fandom)
  • Re: configurable variables in own file?
    ... x> without some compelling reason? ... I was objecting to the use of a Perl programmer as the standard for what ... the double quotes do variable interpolation but otherwise ... so it's best to avoid them unless blah blah blah..." ...
    (comp.lang.perl.misc)
  • Re: Will they run together?
    ... Once again, Frank, could you *please* fix your newsreader posting settings? ... the quotes always came first followed by the replies...much ... discussion groups on the internet, they for some reason seem to want ...
    (rec.models.railroad)