Re: [PHP] reg expressions

2005-03-25 Thread Matthew Fonda
I wouldnt recommend using a regular expression for this. Regular expressions most of the time are now the answer. You could just do something like: foreach ($line as file('/home/virtual/')) { if (substr(trim($line), 0, 1) == '#') { //$line is a comment } else {

RE: [PHP] reg expressions

2005-03-25 Thread Chris W. Parker
Steve Buehler on Friday, March 25, 2005 11:50 AM said: > It would also be fine to just do a loop that checks each line. > Since I guess that would be quicker. If the line starts with > a #, then ignore it, otherwise, do some other stuff. Yeah do this. You don't nee

Re: [PHP] reg expressions

2005-03-25 Thread Steve Buehler
At 01:50 PM 3/25/2005, you wrote: Ok. I am really bad at regular expressions. I have to search through some files and put the contents into an array. A file could look like this: $aliases=`cat /home/virtual/site$site_id/fst/etc/mail/local-host-names`; start of file # local-host-names -

[PHP] reg expressions

2005-03-25 Thread Steve Buehler
Ok. I am really bad at regular expressions. I have to search through some files and put the contents into an array. A file could look like this: $aliases=`cat /home/virtual/site$site_id/fst/etc/mail/local-host-names`; start of file # local-host-names - include all aliases for your machi

Re: [PHP] reg. expressions

2004-10-13 Thread Afan Pasalic
In my case it will be actually "product name (product number)" and always the same. That means Matt's code will do exactly what I need. But, thanks for your post - could happen to use that on other place :) Thanks John -afan John Holmes wrote: Matt M. wrote: on one place I have string "something

Re: [PHP] reg. expressions

2004-10-13 Thread John Holmes
Matt M. wrote: on one place I have string "something (something_2)" I have to take out of the string everything in brackets and brackets as well. probably I will need to use Regular Expression Functions but I'm really bad with them :) $string = "something (something_2)"; $pattern = "/\(.*\)/"; $re

Re: [PHP] reg. expressions

2004-10-13 Thread Afan Pasalic
That was fast! :) Thanks Matt -afan Matt M. wrote: on one place I have string "something (something_2)" I have to take out of the string everything in brackets and brackets as well. probably I will need to use Regular Expression Functions but I'm really bad with them :) $string = "something (somet

Re: [PHP] reg. expressions

2004-10-13 Thread Matt M.
> on one place I have string "something (something_2)" > I have to take out of the string everything in brackets and brackets as > well. > probably I will need to use Regular Expression Functions but I'm really > bad with them :) $string = "something (something_2)"; $pattern = "/\(.*\)/"; $replace

[PHP] reg. expressions

2004-10-13 Thread Afan Pasalic
Hi, on one place I have string "something (something_2)" I have to take out of the string everything in brackets and brackets as well. probably I will need to use Regular Expression Functions but I'm really bad with them :) Please, any help! -afan -- PHP General Mailing List (http://www.php.net/

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brad Hubbard
On Tue, 30 Oct 2001 15:53, brendan wrote: > hans up who else is procrastinating? > ;) My productivity was suckin' pretty badly before all this started anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
hans up who else is procrastinating? ;) Martin Towell wrote: > ARGH!! You, you, missed!! :/ > > > -Original Message- > From: Brad Hubbard [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 30, 2001 3:53 PM > To: Martin Towell; [EMAIL PROTECTED] > Subj

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Martin Towell
ARGH!! You, you, missed!! :/ -Original Message- From: Brad Hubbard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 3:53 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions On Tue, 30 Oct 2001 15:49, Martin Towell wrote: > Here - I'm from

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread David Robley
] > Subject: Re: [PHP] @#$@# Reg Expressions > > On Tue, 30 Oct 2001 14:47, brendan wrote: > > mate you rock.. > > You can tell he's an Australian (on ya mate :-) Stone the bloody crows, cobber, listen to the [nationality] trying ter talk Strine! As a soon-to-be Kiwi r

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brad Hubbard
On Tue, 30 Oct 2001 15:49, Martin Towell wrote: > Here - I'm from NSW, Oz !!! can't make it any harder for you :) > And how are things in York St.? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To c

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Martin Towell
Here - I'm from NSW, Oz !!! can't make it any harder for you :) -Original Message- From: Brad Hubbard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 3:42 PM To: brendan; [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions On Tue, 30 Oct 2001 15:27, bre

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brad Hubbard
On Tue, 30 Oct 2001 15:27, brendan wrote: > Your too late for that .. > recipie boy (aka speedboy) already had a go at us southerners > I reckon you noreasterners are for it next .. > Im working on finding out where he's from so we can make fun of his state > .. Im working hard.. > ill find out..

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
Your too late for that .. recipie boy (aka speedboy) already had a go at us southerners I reckon you noreasterners are for it next .. Im working on finding out where he's from so we can make fun of his state .. Im working hard.. ill find out.. then the jokes'll be flying.. ;) Brad Hubbard wrote:

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brad Hubbard
On Tue, 30 Oct 2001 15:14, brendan wrote: > or really bloody narky afgani's > > Martin Towell wrote: > > Off track - seems like the only ppl awake now are ozzies :) > > would I be right? No jokes about Tamanians or New South Welshmen though alright? -- PHP General Mailing List (http://www.php.n

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brian White
ad Hubbard [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, October 30, 2001 3:11 PM >To: [EMAIL PROTECTED] >Subject: Re: [PHP] @#$@# Reg Expressions > > >On Tue, 30 Oct 2001 14:47, brendan wrote: > > mate you rock.. > >You can tell he's an Australian (on ya mate :-) >

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Jack Dempsey
or the east coast.only 11:35 here in dc -Original Message- From: brendan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 11:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions or really bloody narky afgani's Martin Towell wrote: > Off track - se

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
L PROTECTED] > Subject: Re: [PHP] @#$@# Reg Expressions > > > On Tue, 30 Oct 2001 14:47, brendan wrote: > >>mate you rock.. >> > > You can tell he's an Australian (on ya mate :-) > > -- PHP General Mailing List (http://www.php.net/) To unsubscr

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Martin Towell
Off track - seems like the only ppl awake now are ozzies :) would I be right? -Original Message- From: Brad Hubbard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 3:11 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions On Tue, 30 Oct 2001 14:47, brendan wrote

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Brad Hubbard
On Tue, 30 Oct 2001 14:47, brendan wrote: > mate you rock.. You can tell he's an Australian (on ya mate :-) -- Brad Hubbard Congo Systems 1/286 Bolton Street, Eltham Victoria, Australia, 3095. Email: [EMAIL PROTECTED] Ph: +61-3-94391200 Fax: +61-3-94391255 Mob: +61-419107559 -- PHP General Ma

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
- > From: Jack Dempsey [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 30, 2001 2:30 PM > To: brendan; [EMAIL PROTECTED] > Subject: RE: [PHP] @#$@# Reg Expressions > > > brendan, please clarify: you're "trying to strip out all links in the page > that is betw

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Martin Towell
e you trying to get the links returned or just split on them? i missed > your original post. > watch your caps as well... > > i'd use preg_split also > > jack > > -----Original Message- > From: brendan [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 29, 20

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Jack Dempsey
r just split on them? i missed > your original post. > watch your caps as well... > > i'd use preg_split also > > jack > > -Original Message- > From: brendan [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 29, 2001 9:59 PM > To: [EMAIL PROTECTED] > Subje

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
inks returned or just split on them? i missed > your original post. > watch your caps as well... > > i'd use preg_split also > > jack > > -Original Message- > From: brendan [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 29, 2001 9:59 PM > To: [EMAIL P

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Jack Dempsey
bject: [PHP] @#$@# Reg Expressions thanks but it didnt work either .. ;) Matt Friedman wrote: > Try putting a "?" after your quantifier for "non-greedy" matching. > > Something like: $the_array=split("", $html,-1); > > Matt. > > > > - Ori

RE: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Martin Towell
what something like: $the_array=split("]*)", $html,-1); ?? so, everything that's not a ">" -Original Message- From: brendan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: [PHP] @#$@# Reg Expressions tha

[PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
From: "brendan" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, October 29, 2001 7:55 PM > Subject: [PHP] @#$@# Reg Expressions > > > >>love em.. right now I hate em.. >> >>can someone inform me why the below doesnt wo

Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread Matt Friedman
Try putting a "?" after your quantifier for "non-greedy" matching. Something like: $the_array=split("", $html,-1); Matt. - Original Message - From: "brendan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 2

[PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan
love em.. right now I hate em.. can someone inform me why the below doesnt work? it is intended to strip out all the links in a page and return an array .. insanity is just starting to set in.. cheers $html =GETSITE($url); // and put in a new line break behind every anchor tag $the_array=spliti