Ask a Question related to PHP Development, Design and Development.
-
Curt Zirzow #1
Re: [PHP] Q on Regular Expressions
* Thus wrote jsWalter (jsWalter@torres.ws):
have you looked at strtotime()?> I have a fairly complicated regular expression that was written for perl.
>
> I've spent the last 4 days trying to convert it to PHP.
[url]http://php.net/strtotime[/url]
The Date formats it can find are defined here:
[url]http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html[/url]
Those regex's look like a nightmare, like they usually do :)
>
> # Does input match this RegEx?
>
> (($day,$mon,$yr,$hr,$min,$sec,$tz) =
> /^
> (\w{1,3}) # month
> \s+
> (\d\d?) # day
> \s+
> (\d\d?):(\d\d) # hour:min
> (?::(\d\d))? # optional seconds
> \s+
> (?:([A-Za-z]+)\s+)? # optional timezone
> (\d+) # year
> \s*$ # allow trailing whitespace
> /x)
>
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Curt Zirzow Guest
-
RE : RE : Regular expressions
I think I begin to understand... I begin by fetching the results of the ps -efA command and split it into many variables ($uid, $pid, etc.) ... -
PHP regular expressions
Hello, I am writing an elearning software with php. I need a script to recognize any inut of the type ab,aabb,aaabbb,aaaabbbb..... And so on.... -
[PHP-DEV] PHP regular expressions
Hello. In regex/utils.h there is a definition for DUPMAX: #ifdef _POSIX2_RE_DUP_MAX #define DUPMAX _POSIX2_RE_DUP_MAX #else #define DUPMAX 255... -
Help with regular expressions.
Apples and Oranges: I think your format string is wrong, try: {0:d} "Pablo Pecora" <pablo.pecora@itau.com.ar> wrote in message... -
help with regular expressions
Hello, just getting grips with Perl and RE, but need your help. I am trying to open a file, print its contents to a textbox, but extract... -
Jswalter #2
Re: [PHP] Q on Regular Expressions
Thanks for the pointer, but this only deals with date/time in EPOCH range.
I'm trying to handle dates pre-epoch.
Thanks
Walter
"Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message
news:20030917211347.GF4251@bagend.shire...perl.> * Thus wrote jsWalter (jsWalter@torres.ws):> > I have a fairly complicated regular expression that was written for>> >
> > I've spent the last 4 days trying to convert it to PHP.
> have you looked at strtotime()?
> [url]http://php.net/strtotime[/url]
>
> The Date formats it can find are defined here:
> [url]http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html[/url]
>
>
> Those regex's look like a nightmare, like they usually do :)
>>> >
> > # Does input match this RegEx?
> >
> > (($day,$mon,$yr,$hr,$min,$sec,$tz) =
> > /^
> > (\w{1,3}) # month
> > \s+
> > (\d\d?) # day
> > \s+
> > (\d\d?):(\d\d) # hour:min
> > (?::(\d\d))? # optional seconds
> > \s+
> > (?:([A-Za-z]+)\s+)? # optional timezone
> > (\d+) # year
> > \s*$ # allow trailing whitespace
> > /x)
> >
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."Jswalter Guest



Reply With Quote

