Click to See Complete Forum and Search --> : Reg expressions question


Justin
01-24-2006, 06:43 PM
Reg expressions question

im not very good at them... how do you get somthing like this
343434|03-0391.08c.pdf|January 15, 2006

into 3 vars like this

$thefileid = 343434
$thefilename = 03-0391.08c.pdf
$thefiledisplay = January 15, 2006

basically seporate an entry into 3 vars, and the | is what seporates the data

NogDog
01-24-2006, 07:16 PM
You don't really need a regexp.

list($thefileid, $thefilename, $thefiledisplay) = explode("|", "the|string|here");

Justin
01-24-2006, 09:04 PM
That is EXACTLY what I needed!!!

Thanks!

Markbad311
01-25-2006, 11:11 AM
What exactly is a "regular expression" and also where can I learn about how to make them?

NogDog
01-25-2006, 11:20 AM
What exactly is a "regular expression" and also where can I learn about how to make them?
Regular Expression Functions (Perl-Compatible) (http://www.php.net/pcre) (my preferred modus operandi)
Regular Expression Functions (POSIX Extended) (http://www.php.net/manual/en/ref.regex.php)

cafrow
01-25-2006, 12:00 PM
What exactly is a "regular expression" and also where can I learn about how to make them?

http://www.regular-expressions.info/ is this another good one. I have wanted to learn Regexs but I just cannot get myself to read up on it. One of these days I will, one of these days....