Re: [PHP] EREGI_REPLACE? HELP!!!

2005-01-20 Thread Greg Donald
On Thu, 20 Jan 2005 11:19:10 -0600, Kiason Turner <[EMAIL PROTECTED]> wrote: > I'm trying to take a string and remove all "invalid characters" from it. > > $string="Frid#ays are@ re$ally G{}[]RE~AT. F*rid<>ay at 5 is be^tt&er."; > > The only characters that should be allowed are A-Z, a-z, 0-9, >

RE: [PHP] EREGI_REPLACE? HELP!!!

2005-01-20 Thread Chris W. Parker
Kiason Turner on Thursday, January 20, 2005 9:19 AM said: > I'm trying to take a string and remove all "invalid characters" from > it. > > $string="Frid#ays are@ re$ally G{}[]RE~AT. F*rid<>ay at 5 is > be^tt&er."; > Any ideas? Your help is appreciated. What have

Re: [PHP] eregi_replace()

2004-07-09 Thread John Taylor-Johnston
Sorry. I have it working. My fault. I had a previous line: $mydata->ST = eregi_replace($searchenquiry, "".$searchenquiry."", $mydata->ST); THANKS! John "Matt M." wrote: > > $searchenquiry = "Never cry Wolfe" > > and > > $mydata->ST contains "... Never Cry Wolfe ..." > > > > This code echos: > > "

Re: [PHP] eregi_replace()

2004-07-09 Thread John Taylor-Johnston
>isnt that what you want? I don't see anything in the manual that says it can't? http://ca3.php.net/manual/en/function.preg-replace.php Thanks for trying. John > > $searchenquiry = "Never cry Wolfe" > > and > > $mydata->ST contains "... Never Cry Wolfe ..." > > > > This code echos: > > ".preg_re

Re: [PHP] eregi_replace()

2004-07-09 Thread John Taylor-Johnston
>isnt that what you want? Hmm? Yes. But it doesn't work for me? It cannot be a php verison thing, can it? I have phpversion() 4.1.2. I don't get it? :) Compare with: http://compcanlit.usherbrooke.ca/new1/db/index.php?searchenquiry=Never%20Cry%20Wolfe and then: http://compcanlit.usherbrooke.ca/new1

Re: [PHP] eregi_replace()

2004-07-09 Thread Matt M.
> $searchenquiry = "Never cry Wolfe" > and > $mydata->ST contains "... Never Cry Wolfe ..." > > This code echos: > ".preg_replace ('/('.$searchenquiry.')/i' , "$1", > $mydata->ST)."  > > ... Never cry Wolfe ... > > But I want it to use the original text and echo: > > ... Never Cry Wolfe ... I

Re: [PHP] eregi_replace driving me nuts

2004-07-09 Thread Matt M.
> What I'm trying to do: > > I'm trying to have the proper variables for the eregi_replace so that each > word in the $dico array is replaced by a link to its definition respecting > the following rules : > -only exact match makes a link to the definition, for example : > - "abaisseraient" do

Re: [PHP] eregi_replace()

2004-07-09 Thread John Taylor-Johnston
$searchenquiry = "Never cry Wolfe" and $mydata->ST contains "... Never Cry Wolfe ..." This code echos: ".preg_replace ('/('.$searchenquiry.')/i' , "$1", $mydata->ST)."  ... Never cry Wolfe ... But I want it to use the original text and echo: ... Never Cry Wolfe ... Do-able? > try this > echo

Re: [PHP] eregi_replace()

2004-07-09 Thread Matt M.
> The problem is $searchenquiry would be contained inside $mydata->JR so I would need > to see if it exists and then put ... around it, without changing the original > case. what do you have in $searchenquiry? try this echo preg_replace ('/('.$searchenquiry.')/i' , "$1", $mydata->JR); -- PH

Re: [PHP] eregi_replace()

2004-07-09 Thread John Taylor-Johnston
>if (strtoupper($searchenquiry) == strtoupper($mydata->JR) ) The problem is $searchenquiry would be contained inside $mydata->JR so I would need to see if it exists and then put ... around it, without changing the original case. Thanks, J "Matt M." wrote: > > $mydata->JR = eregi_replace($sear

Re: [PHP] eregi_replace()

2004-07-09 Thread Matt M.
> $mydata->JR = eregi_replace($searchenquiry, "".$searchenquiry."", > $mydata->JR); > echo $searchenquiry; > > What I should display is if $searchenquiry = $mydata->JR in a case insensitive way > then > echo "".$searchenquiry.""; > > Do I use if (x =~ b) {} or some sort of string compare or ...

Re: [PHP] eregi_replace help needed

2004-01-29 Thread memoimyself
Hi Nico, On 29 Jan 2004 at 17:52, [EMAIL PROTECTED] wrote: > I want to locate patterns such as > > 12345678 > 1 23 45 67 89 > 1 2 34 567 890 > > and replace the pattern string with a new string. > > I tried > > $filter['message'] = eregi_replace("[0-9\s]{4,}",'', > $filter['message']); Use

RE: [PHP] eregi_replace help needed

2004-01-29 Thread php4
Hi, the "off the top of your head" was perfect. It is contrary to everything I've read on this, but it did the trick. >off the top of my head, I don't think '\s' is valid in a character >class, so just use ' ' instead >try eregi_replace("[0-9 ]{4,}" >-Craig Thanks Nico -- PHP General Mai

RE: [PHP] eregi_replace help needed

2004-01-29 Thread craig
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: January 29, 2004 8:53 AM > To: [EMAIL PROTECTED] > Subject: [PHP] eregi_replace help needed > > > Hi, > > I want to locate patterns such as > > 12345678 > 1 23 45 67 89 > 1 2 34 567 890 > > and replace t

Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
Holmes: >That's just the pattern you showed. It may not match anything, so nothing gets > replaced with eregi_replace() and hence no "active link" is created, but > it may not necessarily cause an error. . Right. The pattern does not match anything in the input string of $Arra

RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
> $Pattern = "(http://)?([^[:space:]]+)([[:alnum:]\.,-_?/&=])"; > $Replace = "http://\\2\\3\"; target=\"_new\">\\2\\3"; > $Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]); > > print ("Your submission--$Array[URL]--has been received!\n"); That does no checking or validation at all.

Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
> Well, whether it causes an error not depends on your code. That's just > the pattern you showed. It may not match anything, so nothing gets > replaced with eregi_replace() and hence no "active link" is created, but > it may not necessarily cause an error. > > Can you show me some of the code in c

RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
> For instance, let's say I put _absolutely nothing_ in the URL textbox and > then hit submit - the PHP still processes _without_ an error. > > It says: > "Your submission -- -- has been received!" > > I would've thought the eregi_replace() function would've validated an > entry > with no charact

Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
John W. Holmes: > Yes, that's correct. That piece of the pattern matches anything that's > not a space, one or more times. > > > I tried the script by putting a space before the URL and the PHP still > > processes the data with no error. > > A space before everything is fine, as the pattern will m

RE: [PHP] eregi_replace() function in a script

2002-12-01 Thread John W. Holmes
> The script works fine but I have a question with the following line: > > $Pattern="(http://)([^[:space:]]+) ([[:alnum:]\.,-?/&=])"; // The variable > $Pattern is declared with three groupings. > > My question: > If the user inadvertantly inputs a *space* _after_ the http:// grouping > and > _be

Re: [PHP] eregi_replace help

2002-10-07 Thread Jennifer Swofford
Thank you Marco! Between your post and the other stuff I happened to find at the same time, I got it working. Turned out I was making it much more difficult than it had to be. I ended up with: http://www.blah.com/$4.$6\"";, $contents); echo $contents; fclose ($fd); ?> Lo and behold, it works

Re: [PHP] eregi_replace help

2002-10-07 Thread Marco Tabini
Jennifer-- A couple of things. eregi_replace does not have a limitation parameter, which means that if you use it *all* the strings that match your pattern will be replace with the new pattern. In your case, if I read your code correctly (and I may not--I'm doing this from memory), the eregi repl

Re: [PHP] eregi_replace help

2002-10-07 Thread Jennifer Swofford
BTW - I have found errors in the regular expression that I was matching so don't bother to point those out. ;) That shouldn't affect the nature of the problem I was asking about. --- Jennifer Swofford <[EMAIL PROTECTED]> wrote: > Hello all, > > I am trying to use php to read through an html fil

Re: [PHP] eregi_replace / preg_match_all

2002-10-02 Thread Jennifer Swofford
Extraordinarily helpful; thank you very much! Thanks to both Mike and Kevin on this. Jen > > > Why does this work: > > > > > > $contents = > > > > > eregi_replace("(\")(.(/))*[A-Z0-9_/-]+(.gif|.jpg)", > > > "\"blah.gif", $contents); > > > > > > But this does not: > > > > > > > > preg_match_all(

RE: [PHP] eregi_replace / preg_match_all

2002-10-02 Thread Ford, Mike [LSS]
> -Original Message- > From: Jennifer Swofford [mailto:[EMAIL PROTECTED]] > Sent: 01 October 2002 21:21 > To: [EMAIL PROTECTED] > Subject: [PHP] eregi_replace / preg_match_all > > > Why does this work: > > $contents = > eregi_replace("(\")(.(/))*[A-Z0-9_/-]+(.gif|.jpg)", > "\"blah.gif",

Re: [PHP] eregi_replace / preg_match_all

2002-10-01 Thread Kevin Stone
ession at the second slash. -Kevin - Original Message - From: "Jennifer Swofford" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 01, 2002 3:03 PM Subject: Re: [PHP] eregi_replace / preg_match_all > Thanks Kevin - > > Actually, I'm confused

Re: [PHP] eregi_replace / preg_match_all

2002-10-01 Thread Jennifer Swofford
Thanks Kevin - Actually, I'm confused about that too, because this does NOT work (delimeter): $contents = eregi_replace("/(\")(.(/))*[A-Z0-9_/-]+(.gif|.jpg)/", "\"blah.gif", $contents); But this does (no delimeter): $contents = eregi_replace("(\")(.(/))*[A-Z0-9_/-]+(.gif|.jpg)", "\"blah.gif",

Re: [PHP] eregi_replace / preg_match_all

2002-10-01 Thread Kevin Stone
Unknown modifier definitely has to do with the regular expression. Don't regex's need a beginning and ending delimeter apart from the quote? "/(\")(.(\/))*[A-Z0-9_\/-]+(.gif|.jpg)/" Maybe that's it? But if so I dunno why the other one would be working. -Kevin - Original Message - From

RE: [PHP] eregi_replace and regular expressions

2002-09-30 Thread John W. Holmes
> I am trying to add html code using php on the fly while uploading web > pages > to our database. All of my replace functions seem to work well except > one. > I am trying to add a tag after the body tag. It is easy to find > the body tag because there is only one " having a terrible time tryi

Re: [PHP] eregi_replace() problems

2002-08-30 Thread Kevin Stone
The parameters to the eregi_replace() are not passed by reference. You need to set a variable to capture the returning value. Read the manual.. http://www.php.net/manual/en/function.eregi-replace.php -Kevin - Original Message - From: "Tony Harrison" <[EMAIL PROTECTED]> To: <[EMAIL PROT

Re: [PHP] Eregi_replace

2002-08-22 Thread Bas Jobsen
eregi_replace(']+>','',$string); Op donderdag 22 augustus 2002 14:42, schreef Roman Duriancik: > How to create pattern for function eregi_replace to > replace in html document every html tag for empty string. > > Thanks > > > roman -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Chris Shiflett
In a weak attempt at improving my knowledge of regular expressions, I came up with a less elegant solution than Dan's. :-) $os=eregi_replace("Win([^0-9NT]*)", "Windows \1" $os); This adds some additional handy replacements, such as: Winblows98 -> Windows 98 Windoze98 -> Windows 98 It's a dece

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Analysis & Solutions
On Tue, Jul 09, 2002 at 10:40:33PM -0500, Chris Shiflett wrote: > Patrick Teague wrote: > > >$os = eregi_replace( "Win[^dows]", "Windows ", $os ); > > I'm pretty sure (I'm not a regular expression expert) this matches "a > string that begins with Win followed by a character that is not d, o, w,

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Chris Shiflett
Patrick Teague wrote: >For some reason the following line is not behaving > >$os = eregi_replace( "Win[^dows]", "Windows ", $os ); > I'm pretty sure (I'm not a regular expression expert) this matches "a string that begins with Win followed by a character that is not d, o, w, or s. Thus, in th

RE: [PHP] eregi_replace

2002-04-04 Thread Maxim Maletsky
> > $qq = "V:\\memo\\F0001\\abcdef.com"; > print "$qq\n"; > $qx = ereg_replace("V:\\",'',$qq); > print $qx; > > out: > > V:\memo\F0001\abcdef.com > Warning: Trailing backslash in /home/rodolfo/public_html/test.php on line > 5 I think it should be: $qx = ereg_replace("V:",'',$qq); Sinc

RE: [PHP] eregi_replace

2002-04-04 Thread Rodolfo Gonzalez
On Thu, 4 Apr 2002, Rick Emery wrote: > it should print: > V:\memo\F0001\abcdef.com > \F0001\abcdef.com Indeed, sorry for the lapsus. In fact, look at this: in: $qq = "V:\\memo\\F0001\\abcdef.com"; print "$qq\n"; $qx = ereg_replace('V:\\','',$qq); print $qx; out: Parse error: parse error in

RE: [PHP] eregi_replace

2002-04-04 Thread Rick Emery
it should print: V:\memo\F0001\abcdef.com \F0001\abcdef.com -Original Message- From: Rodolfo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 2:35 PM To: Rick Emery Cc: 'Fredrik Arild Takle'; [EMAIL PROTECTED] Subject: RE: [PHP] eregi_replace I got this as

RE: [PHP] eregi_replace

2002-04-04 Thread Rodolfo Gonzalez
I got this as output: V:\memo\F0001\abcdef.com V:\memo\F0001\abcdef.com But no errors. Where does it fail? php-4.0.6-5mdk On Thu, 4 Apr 2002, Rick Emery wrote: > I think you found a bug in PHP. > > I even tried simple things like: > $qq = "V:\\memo\\F0001\\abcdef.com"; > print "$qq\n"; > $qx

RE: [PHP] eregi_replace

2002-04-04 Thread Rick Emery
ECTED]] Sent: Thursday, April 04, 2002 3:18 PM To: Rick Emery Subject: RE: [PHP] eregi_replace > $NoteNm[$i] = eregi_replace ("V:\memo\F0001\", "", "$NoteNm[$i]"); > $NoteNm[$i] = eregi_replace ("\\LOBBY\VismaDok\Memo\", "", &

Re: [PHP] eregi_replace

2002-04-04 Thread Miguel Cruz
On Thu, 4 Apr 2002, Fredrik Arild Takle wrote: >> Backslashes are magic. >> >> Double them and try again (e.g., --- >> >>$NoteNm[$i] = eregi_replace ("LOBBY\\VismaDok\\Memo\\", ... > > Well I've allready tried that one: > > Outputs: > Warning: REG_EESCAPE:~trailing backslash (\) in > D:\

RE: [PHP] eregi_replace

2002-04-04 Thread Rick Emery
show the whole line of coding again. very few of us keep threads. include previous responses -Original Message- From: Fredrik Arild Takle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 3:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] eregi_replace > Backslashes are ma

Re: [PHP] eregi_replace

2002-04-04 Thread Fredrik Arild Takle
> Backslashes are magic. > > Double them and try again (e.g., --- > >$NoteNm[$i] = eregi_replace ("LOBBY\\VismaDok\\Memo\\", ... Well I've allready tried that one: Outputs: Warning: REG_EESCAPE:~trailing backslash (\) in D:\Inetpub\wwwroot\www_lobb\phpshop.php on line 28 Warning: REG_EE

Re: [PHP] eregi_replace

2002-04-04 Thread Miguel Cruz
On Thu, 4 Apr 2002, Fredrik Arild Takle wrote: > Why won't this work? > > $NoteNm[$i] = eregi_replace ("V:\memo\F0001\", "", "$NoteNm[$i]"); > $NoteNm[$i] = eregi_replace ("\\LOBBY\VismaDok\Memo\", "", > "$NoteNm[$i]"); Backslashes are magic. Double them and try again (e.g., ---

RE: [PHP] eregi_replace

2002-04-04 Thread Rick Emery
Because you did NOT \\ all your \'s What error are you getting? -Original Message- From: Fredrik Arild Takle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] eregi_replace Why won't this work? $NoteNm[$i] = eregi_replace ("V:

Re: [PHP] eregi_replace probs

2001-11-16 Thread phantom
oh duh, why is it always the simplest reason. :) fixed it and it runs good now. thank you sir! Jim Lucas wrote: > sorry didn't notice the & in the args > you'll want this instead. > > > function scan_string(&$str) { > > $forbid = array ("coke", "tylenol", "ford"); > > $swap = array ("

Re: [PHP] eregi_replace probs

2001-11-16 Thread Jim Lucas
sorry didn't notice the & in the args you'll want this instead. > function scan_string(&$str) { > $forbid = array ("coke", "tylenol", "ford"); > $swap = array ("pepsi", "advil", "chevrolet"); > for ($i = 0; $i < count ($forbid); $i++) { > $str = eregi_replace($forbid[$i],$swa

Re: [PHP] eregi_replace probs

2001-11-16 Thread Jim Lucas
eregi_replace isn't your problem this funciton "RETURNS" the new string. > function scan_string(&$str) { > $forbid = array ("coke", "tylenol", "ford"); > $swap = array ("pepsi", "advil", "chevrolet"); > for ($i = 0; $i < count ($forbid); $i++) { > $NEW_STRING = eregi_replace(

RE: [PHP] eregi_replace problem

2001-09-22 Thread Daniel Goldin
DSolved. Problem was a typo in other script called by this one. Many apologies to the list. Best, daniel -Original Message- From: Daniel Goldin [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 9:08 PM To: [EMAIL PROTECTED] Subject: [PHP] eregi_replace problem The following