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

[PHP-WIN] ereg_replace question

2004-05-07 Thread Volvo
Hi I have a line as "Field Name1(m/s)","Field Name2(volt)","Field Name3(m/s)" I want to replace everything starting with ( and ending with ) so srting will become "Field Name1","Field Name2","Field Name3" Does anyone know how to do it? TIA -- PHP Windows Mailing List (http://www.php.net/) T

[PHP-WIN] ereg_replace...

2003-04-05 Thread Bobo Wieland
is there some way to change the following code: $wrd = ereg_replace("[^[:alnum:]]", "", $wrd); so that it does not remove å,ä and ö? .bobo -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-WIN] ereg_replace

2003-02-12 Thread Dash McElroy
I would just cut the text off via explode at the ? mark. i.e.: $shorturl = explode("?", $str, 1); //may or may not work... then echo $shorturl[0]; -Dash Sturgeon's Law: 90% of everything is crud. On Wed, 12 Feb 2003, Bobo Wieland wrote: > I'm using ereg_replace to find urls as said i

[PHP-WIN] ereg_replace

2003-02-12 Thread Bobo Wieland
I'm using ereg_replace to find urls as said in the manual. I've changed it a tiny litte bit to remove the http:// part when displaying the link, like this: $str = ereg_replace("([[:alpha:]]+://)([^<>[:space:]]+[[:alnum:]/])","\\2", $str); I'm trying to get the grips of regular expressions but I c