Re: [PHP] Re: parsing a string

2004-10-20 Thread Dan McCullough
I tried the print_r on $res. The preg_match does the first set fine. So I get: Campus Bob (Williams) the second one starts - Address123 Main St - CityOxford and so on [EMAIL PROTECTED] wrote: preg_match('#([^|]*)[|]+([^|]*)~[\\]+(([^\\]*)~[\\]+)+#Ui', $string, $res

Re: [PHP] Re: parsing a string

2004-10-20 Thread Dan McCullough
I knew I shouldnt have abreviated the string. here is the string sorry I kinda flubbed on the last string "LocationCampus~\\n-\nNameBob Williams~\\n-\nAddress123 Main St~\\n-\n..." the ... is a very long list. how does this change the

[PHP] Re: parsing a string

2004-10-20 Thread M. Sokolewicz
Not sure what you want exactly, but here's a way using regexps to retrieve the strings seperatly: $string = 'CampusBob (Williams)~\toms more crap)~\blah blah blah)~\'; preg_match('#([^|]*)[|]+([^|]*)~[\]+([^\]*)~[\]+([^\]*)~[\]+#Ui', $string, $res); $campus = $re

[PHP] Re: parsing a string

2004-10-20 Thread Greg Beaver
Dan McCullough wrote: Hey everyone Having a bit of trouble with something. I have a string which has known patterns. $string"CampusBob (Williams)~\toms more crap)~\blah blah blah)~\"; What I am looking for is Location which is Campus

[PHP] Re: parsing a string

2001-10-31 Thread John A. Grant
"Yz James" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey John, > something like this might work: > > > $string = "This is a string with an embedded image [bird.gif,this is a > bird]"; > > $string = preg_replace("/\[(.*?\.)(gif|jpg),(.*?)\]/i", " alt=\"\\3

[PHP] Re: parsing a string

2001-10-18 Thread James, Yz
Hey John, something like this might work: ", $string); echo $string; ?> James "John A. Grant" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm reading some HTML text from a file and echoing it to > stdout. The HTML text contains but I would rather > hav