[RESOLVED] ereg help for lookbehind and lookforward
What is the syntax for lookbehind and lookforward with ereg? I try to match the month part of a date, and it can look like this:
2005-05-30
or
2005/05/30
and I only want the 05 part. I tried something like this:
eregi('(?<=[-/])[[:digit:]][[:digit:]](?=[-/])', $date, $res))
but doesn't look like it liked that way of doing this, but it works perfectly fine in my regex-coach.
- ØØ -
Re: ereg help for lookbehind and lookforward
Re: ereg help for lookbehind and lookforward
Why didn't you say so right away...grr...works now..:)
if(preg_match('/(?<=[-\/])\n\n(?=[-\/])/i', $date, $res)){
- ØØ -