RE: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread George Pitcher
Thanks to all who chipped in. I'm going with John Asendorf's '$pages = ereg_replace ( "[^0-9cdilmvx,]" , "-" , $pages);' which works for me. Tom wrote: > But do you really want an "A" (etc.) to be considered a dash? Yes, because it is not a valid pagerange character. Cheers, and thanks for sav

RE: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread trlists
On 29 Sep 2004 George Pitcher wrote: > In short I'm looking to search for any character that is NOT one of the > following: > > "0-9 cdilmvx ," and replace it with '-' [chr(45)] (I do an initial strip of > spaces at the beginning of the process). Try something like: $newstring = preg_re

Re: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread Felipe Gasper
acter that is NOT one of the following: "0-9 cdilmvx ," and replace it with '-' [chr(45)] (I do an initial strip of spaces at the beginning of the process). Cheers George -Original Message- From: Asendorf, John [mailto:[EMAIL PROTECTED] Sent: 29 September 2004 3:43 pm

RE: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread George Pitcher
of spaces at the beginning of the process). Cheers George > -Original Message- > From: Asendorf, John [mailto:[EMAIL PROTECTED] > Sent: 29 September 2004 3:43 pm > To: George Pitcher; [EMAIL PROTECTED] > Subject: RE: [PHP-WIN] ereg_replace help wanted > > > Act

RE: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread Asendorf, John
al Message- From: George Pitcher [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 9:46 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] ereg_replace help wanted Hi, I don't want to spend a lot of time leaning how to use this function but I have a problem that I think it can solve

Re: [PHP-WIN] ereg_replace help wanted

2004-09-29 Thread trlists
On 29 Sep 2004 George Pitcher wrote: > The problem is that I think that some of my users are pasting the range in, > rather than re-typing (I don't really want to stop them from pasting) and I > am sure that sometimes the '-' is coming over as something other than a > conventional hyphen. > > Can

[PHP-WIN] ereg_replace help wanted

2004-09-29 Thread George Pitcher
Hi, I don't want to spend a lot of time leaning how to use this function but I have a problem that I think it can solve. I have a web form that allows the user to (amongst other things) submit a pagerange to my database. Using '-' and ',' as separators, I am able to calculate the number of pages