preg syntax is different to ereg (which you are using). You also need to
provide an output variable.
This would work:
preg_match( /[0-9]+/, $input, $output );
--
Matt
Carl E Shmidt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Now I'm looking to find 1 or
You can do recursive matching using the (?R) syntax in preg functions (Perl
Compatible Regular Expression).
- Original Message -
From: Christopher William Wesley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Cameron Just [EMAIL PROTECTED]
Sent: Tuesday, March 26, 2002 1:01 AM
Subject: Re:
Very nice. I was going to suggest:
?php
$input = wed-thurs 9:35, 14:56, 18:35, 21, 22, 23:59;
preg_match( /([a-z]+)-([a-z]+)((?:\s[0-9]+(?::[0-9]+)?,?)*)/, $input,
$output, PREG_SET_ORDER );
$output[3] = preg_replace( /,/, , trim($output[3]) );
$times = explode( , $output[3] );
?
But uhhh,
Perl Compatible Regular Expression:
/'([a-z]+)-([a-z]+)\s([0-9]+:[0-9]+),\s([0-9]+:[0-9]+),\s([0-9]+:[0-9]+)'/
Assuming the days of the week are always lower case? if not then use
[a-zA-Z] for the day matching.
Hope this helps.
--
Matt.
- Original Message -
From: Cameron Just [EMAIL
Oh, I didnt read the bit at the bottom about the times appearing any number
of times. Off the top of my head I think this should work...
PREG:
/'([a-z]+)-([a-z]+)\s(?:([0-9]+(?::[0-9]+|))(?:,\s)?)*'/
--
Matt
- Original Message -
From: Cameron Just [EMAIL PROTECTED]
To: [EMAIL
You can convert both date formats into a UNIX timestamp, then do a
picturedate logindate.
To convert them into a unix timestamp you need to use strtotime function
http://www.php.net/manual/en/function.strtotime.php
$ldate = strtotime($logindate);
$pdate = strtotime($picturedate);
You could use the following preg statement:
preg_match_all( /table(.*(?=\/table))/, $string, $output,
PREG_SET_ORDER );
This would put all matches of tablesome code, text, whatever/table into
the $output array. however you would start to have problems when you come
across nested tables. You'd
If you dont mind downloading ~50 messages a day, then I'd recommend this
group :]
Regards
Matt.
- Original Message -
From: Julie Hull [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 03, 2002 2:16 AM
Subject: [PHP] Holy Moly...
Could someone please direct a total
Im looking to change my hosting provider.
...something that isnt going to break the bank, is feature full, supports mysql, php
etc etc and doesnt limit your bandwidth usage! I need about 100+ mb's of space, and
possibly the ability to run a background process.
Can anyone here suggest a
Hey guys. Any insight into this problem im experiencing would be much appriciated...
I installed some software on my web space a while back, I ran a script and it
extracted some files from a tar ball I had uploaded. This was all designed to make
the package easy to install and set up. The
10 matches
Mail list logo