Re: [PHP] regex

2002-03-27 Thread Matt Moreton
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

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Matt Moreton
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:

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Matt Moreton
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,

[PHP] Regular Expression Challenge

2002-03-24 Thread Matt Moreton
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

Re: [PHP] Regular Expression Challenge

2002-03-24 Thread Matt Moreton
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

Re: [PHP] Getting days after last login. Date problem

2002-02-13 Thread Matt Moreton
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);

Re: [PHP] take links from url

2002-01-06 Thread Matt Moreton
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

Re: [PHP] Holy Moly...

2002-01-02 Thread Matt Moreton
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

[PHP] Hosting provider...

2002-01-01 Thread Matt Moreton
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

[PHP] Deleting files?

2001-12-30 Thread Matt Moreton
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