Re: [PHP] ereg help!

2008-01-09 Thread Richard Heyes
$out = basename($file, .html) . .com; fairly limited i think, but simple. Nothing wrong with being simple, and therefore both fast and easy to understand by a wider audience. The only downer I can immediately think of though is that whitespace isn't accommodated, but who really ends a file

Re: [PHP] ereg help!

2008-01-09 Thread Anup Shukla
steve wrote: On Tuesday 08 January 2008 20:30:29 Chris wrote: I usually use preg_* functions so here's my go: echo preg_replace('/\.php$/', '.com', $file); The '$' at the end makes sure it's a .php file and won't cause problems with files like xyz.php.txt . (otherwise I'd just use a

Re: [PHP] ereg help!

2008-01-08 Thread Chris
steve wrote: I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the .html extension with .com so it winds up being: website.com instead

Re: [PHP] ereg help!

2008-01-08 Thread steve
On Tuesday 08 January 2008 20:30:29 Chris wrote: I usually use preg_* functions so here's my go: echo preg_replace('/\.php$/', '.com', $file); The '$' at the end makes sure it's a .php file and won't cause problems with files like xyz.php.txt . (otherwise I'd just use a straight str_replace).

Re: [PHP] ereg help!

2008-01-08 Thread Casey
On Jan 8, 2008, at 5:45 PM, steve [EMAIL PROTECTED] wrote: I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the .html extension

Re: [PHP] ereg() problem

2007-01-31 Thread Jim Lucas
jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); do we need to break out of the text to include the $to variable?? testing $route I get: do you mean $get_route? $route

Re: [PHP] ereg() problem

2007-01-31 Thread jekillen
On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); do we need to break out of the text to include the $to variable?? The $to

Re: [PHP] ereg() problem

2007-01-31 Thread Richard Lynch
On Tue, January 30, 2007 8:36 pm, jekillen wrote: I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); testing $route I get: $route = $m[1]; print $route.'br'; jk/in' rec='a_378e6dc4.xml' / (out put of

Re: [PHP] ereg() problem

2007-01-31 Thread Jim Lucas
jekillen wrote: On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); do we need to break out of the text to include the $to

Re: [PHP] ereg() problem

2007-01-31 Thread Jim Lucas
jekillen wrote: On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); do we need to break out of the text to include the $to

Re: [PHP] ereg() problem: solution

2007-01-31 Thread jekillen
Hi In reference to my query about 'greed' in regex in php and the following code $x = ereg(route name='$to' x='\.\./(.*)/in' rec='.*' /, $get_route, $m); I solved the immediate problem with the following: route name='$to' x='\.\./([a-z]{2}|a?u_[0-9a-z]{8})/in' rec='.*' / as you can see, the

Re: [PHP] ereg() problem

2007-01-31 Thread jekillen
On Jan 31, 2007, at 4:38 PM, Richard Lynch wrote: On Tue, January 30, 2007 8:36 pm, jekillen wrote: I am having trouble with ereg(). The following is the problem code $x = ereg(route name='$to' x='../(.*)/in' rec='.*' /, $get_route, $m); testing $route I get: $route = $m[1]; print

Re: [PHP] Ereg problem

2006-06-27 Thread Robert Cummings
On Tue, 2006-06-27 at 12:14, Beauford wrote: One more in my recent woes. The last elseif does not work in the code below - even if the string is correct it always says it's incorrect. Even if I remove everything else and just have the ereg satement is doesn't work either. The code below is

Re: [PHP] Ereg problem

2006-06-27 Thread John Nichel
Beauford wrote: Please turn of your mail client's request for return receipts when sending to a mailing list. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] Ereg problem

2006-06-27 Thread Beauford
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: June 27, 2006 12:58 PM To: Beauford Cc: PHP-General Subject: Re: [PHP] Ereg problem On Tue, 2006-06-27 at 12:14, Beauford wrote: One more in my recent woes. The last elseif does not work in the code below

Re: [PHP] ereg function

2004-12-31 Thread Rasmus Lerdorf
Numbers are pretty easy. You could just do: $age = (int)$_POST['age']; if($age 9) do_something(); else do_something_else(); Using ereg doesn't make much sense in this case. -Rasmus On Fri, 31 Dec 2004, Michael Lutaaya wrote: I want to validate someones age. How do I do this in

Re: [PHP] ereg function

2004-12-31 Thread Rory Browne
The ereg function doesn't have the capability to test the age of the person viewing your page. You have to depend on them to input their age in some way. Your answer depends on how your age is submitted. Assuming it is submited as $_POST['age'], you could perhaps use ereg(0*[7-9]$, $_POST['age'])

RE: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???

2004-04-14 Thread Jay Blanchard
[snip] :#039;( :#039;-( this causes the entire message to disappear: $text = ereg_replace(':#039;-?(','img src='.$smiley_path.'/crying.gif alt=:#039;( width=25 height=15 align=absmiddle',$text); [/snip] Have you tried any of the other regular expression functions available? -- PHP General

[PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread -{ Rene Brehmer }-
Never mind y'all ... me stupid ... obviously the ( has meaning, and needs to be escaped ... was starting to think it could only do 2 ereg's in 1 script *sigh* Sorry for wasting time and bandwidth ... the function now looks like this and works : function gfx_smiley($text) { $smiley_path =

Re: [PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread Tom Rogers
Hi, Thursday, April 15, 2004, 12:51:20 AM, you wrote: RB Never mind y'all ... me stupid ... RB obviously the ( has meaning, and needs to be escaped ... was starting to RB think it could only do 2 ereg's in 1 script *sigh* RB Sorry for wasting time and bandwidth ... the function now looks like

Re: [PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread -{ Rene Brehmer }-
At 15:02 14-04-2004, Tom Rogers wrote: Hi, Thursday, April 15, 2004, 12:51:20 AM, you wrote: RB Never mind y'all ... me stupid ... RB obviously the ( has meaning, and needs to be escaped ... was starting to RB think it could only do 2 ereg's in 1 script *sigh* RB Sorry for wasting time and

Re[2]: [PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread Tom Rogers
Hi, Thursday, April 15, 2004, 8:56:05 AM, you wrote: RB At 15:02 14-04-2004, Tom Rogers wrote: Hi, Thursday, April 15, 2004, 12:51:20 AM, you wrote: RB Never mind y'all ... me stupid ... RB obviously the ( has meaning, and needs to be escaped ... was starting to RB think it could only do 2

Re: [PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread Curt Zirzow
* Thus wrote Tom Rogers ([EMAIL PROTECTED]): Hi, Thursday, April 15, 2004, 8:56:05 AM, you wrote: RB At 15:02 14-04-2004, Tom Rogers wrote: ... RB preg_replace() and ereg_replace(), so it's a bit hard to get a quick RB glimpse of how big the difference really is ... (or for the _match()

Re: [PHP] ereg problem

2004-03-12 Thread Newman Weekly.
Don't worry about this I worked out that the example was wrong (o; - Original Message - From: Newman Weekly. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 13, 2004 1:59 PM Subject: [PHP] ereg problem ?php $formUserName=foobar; if

Re: [PHP] ereg + performance problem

2004-01-02 Thread Mirek Novak
Hi, I think that smarty [ http://smarty.php.net ] can do this for u. It has tag nesting and, of course, you can define your own tag as a plugin. As for performance problem - this is known feature of regexp. Solution is not simple. You, IMHO, have to rethink your approach. For parsing larger

Re: [PHP] ereg + performance problem

2004-01-02 Thread Martin Helie
Hi Mirek, thanks for pointing this out. This looks like a great site -- although, as you say, will require some [longer term] study. I'll have closer look at Smarty as well... Mirek Novak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I think that smarty [

Re: [PHP] ereg is failing on this simple test

2003-12-13 Thread Eugene Lee
On Fri, Dec 12, 2003 at 07:54:16PM -0800, Manuel Ochoa wrote: : : Why is this test failing? : : $data = A Simple test.; : If (ereg(^[a-zA-Z0-9\s.\-_']+$, $data)) { : echo Valid text; : } : else { : echo Not valid text; : } You can't use the character class \s within a range. And you need

RE: [PHP] ereg is failing on this simple test

2003-12-12 Thread Dave G
Why is this test failing? If (ereg(^[a-zA-Z0-9\s.\-_']+$, $data)) { I'm very new to PHP, so I may be barking up the wrong tree, but what is that s doing after the slash? I don't know if it's the cause of the problem, but as far as I know it's superfluous. -- Yoroshiku! Dave G [EMAIL

Re: [PHP] ereg preg

2003-08-15 Thread Curt Zirzow
* Thus wrote Eddy-Das ([EMAIL PROTECTED]): is there any syntax difference between ereg() and preg() except preg needs / and /? There are a lot of differences in syntax. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] ereg problem?

2003-07-25 Thread sven
by the way, it's to complicated. the brackets [ and ] are used for cha-groups. you can leave them for only one char. so this would be the same: \\n (you have to escape the backslash with a backslash) Curt Zirzow wrote: * Thus wrote John W. Holmes ([EMAIL PROTECTED]): [EMAIL PROTECTED] wrote:

RE: [PHP] ereg problem?

2003-07-25 Thread Ford, Mike [LSS]
-Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 10:35 by the way, it's to complicated. the brackets [ and ] are used for cha-groups. you can leave them for only one char. so this would be the same: \\n (you have to escape the backslash with a backslash)

Re: [PHP] ereg problem?

2003-07-24 Thread John W. Holmes
[EMAIL PROTECTED] wrote: who can tell me what's the pattern string mean. if(ereg([\\][n],$username)) { /*Do err*/ } It's looking for a \ character or a \ character followed by the letter n anywhere within the string $username. -- ---John Holmes... Amazon Wishlist:

Re: [PHP] ereg problem?

2003-07-24 Thread Curt Zirzow
* Thus wrote John W. Holmes ([EMAIL PROTECTED]): [EMAIL PROTECTED] wrote: who can tell me what's the pattern string mean. if(ereg([\\][n],$username)) { /*Do err*/ } It's looking for a \ character or a \ character followed by the letter n anywhere within the string $username. I

RE: [PHP] Ereg question

2003-03-30 Thread John W. Holmes
I am using ereg to validate the format of a date entry (mm/dd/yy), but if the year ends in a 0, it is being stripped and as such produces an error. So 1990 would be 199. The dob is being inputted by a form Here is my code: if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$,

Re: [PHP] Ereg question

2003-03-30 Thread Beauford
: Sunday, March 30, 2003 2:28 PM Subject: RE: [PHP] Ereg question I am using ereg to validate the format of a date entry (mm/dd/yy), but if the year ends in a 0, it is being stripped and as such produces an error. So 1990 would be 199. The dob is being inputted by a form Here is my

Re: [PHP] Ereg question

2003-03-30 Thread Beauford
This is what I get when I echo $formsave[dob] - 9/09/199. It was inputted as 09/09/1990. B. - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Beauford' [EMAIL PROTECTED]; 'PHP General' [EMAIL PROTECTED] Sent: Sunday, March 30, 2003 2:28 PM Subject: RE: [PHP] Ereg

Re: [PHP] Ereg question

2003-03-30 Thread Beauford
[EMAIL PROTECTED] To: 'Beauford' [EMAIL PROTECTED]; 'PHP General' [EMAIL PROTECTED] Sent: Sunday, March 30, 2003 2:28 PM Subject: RE: [PHP] Ereg question I am using ereg to validate the format of a date entry (mm/dd/yy), but if the year ends in a 0, it is being stripped and as such produces

RE: [PHP] Ereg question

2003-03-30 Thread John W. Holmes
I thought trim only stripped white space.?. $formsave['dob'] is a session variable. I have also found now that leading 0's are also being stripped. foreach($HTTP_POST_VARS as $varname = $value) $formsave[$varname] = trim($value, 50); If it's not there then the whole script

Re: [PHP] Ereg question

2003-03-30 Thread Jason Wong
On Monday 31 March 2003 04:15, Beauford wrote: Just some more information. It appears that the session variable $formsave[dob] is causing the problem. If I echo the input $_POST['dob'] it shows correctly, but when it's put into $formsave[dob] the leading and ending 0's are being stripped.

Re: [PHP] Ereg question

2003-03-30 Thread Beauford
. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 30, 2003 11:20 PM Subject: Re: [PHP] Ereg question On Monday 31 March 2003 04:15, Beauford wrote: Just some more information. It appears that the session variable $formsave[dob] is causing

Re: [PHP] Ereg question

2003-03-30 Thread Jason Wong
On Monday 31 March 2003 13:58, Beauford wrote: I posted the information as I had it. I had no idea what the problem was and posted the information I thought was FULL and ACCURATE - Full and accurate if taken literally are absolute terms and are objective not subjective. if this isn't good

Re: [PHP] Ereg question

2003-03-30 Thread Beauford
Subject: Re: [PHP] Ereg question On Monday 31 March 2003 13:58, Beauford wrote: I posted the information as I had it. I had no idea what the problem was and posted the information I thought was FULL and ACCURATE - Full and accurate if taken literally are absolute terms and are objective

Re: [PHP] Ereg question

2003-03-30 Thread Peter Houchin
Beauford, Jason, Build a bridge and get over it already sheeesh TYVMIA Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Ereg sass

2003-03-18 Thread Hugh Danaher
try two backslashes to escape php special characters - Original Message - From: Liam Gibbs [EMAIL PROTECTED] To: php list [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 12:33 AM Subject: [PHP] Ereg sass I'm not sure why, but I can't include a period in my eregi statement:

Re: [PHP] Ereg sass

2003-03-18 Thread Liam Gibbs
try two backslashes to escape php special characters Tried that with the same result. I'm not sure why, but I can't include a period in my eregi statement: [A-Za-z0-9_-.]* For this, I get Warning: ereg() [function.ereg]: REG_ERANGE in /home/website/public_html/Functions.inc on line 27

RE: [PHP] Ereg sass[Scanned]

2003-03-18 Thread Michael Egan
Try [A-Za-z0-9_\-\.]* -Original Message- From: Liam Gibbs [mailto:[EMAIL PROTECTED] Sent: 18 March 2003 08:52 To: php list Subject: Re: [PHP] Ereg sass[Scanned] try two backslashes to escape php special characters Tried that with the same result. I'm not sure why, but I can't

Re: [PHP] Ereg sass

2003-03-18 Thread Jason k Larson
It's seeing the - as a range identifier, escape it to get the literal hyphen. How about this: [a-zA-Z0-9_\-.]* In my tests, the period didn't need to be escaped with the \. HTH, Jason k Larson Liam Gibbs wrote: I'm not sure why, but I can't include a period in my eregi statement:

Re: [PHP] Ereg sass

2003-03-18 Thread Ernest E Vogelsinger
At 10:36 18.03.2003, Jason k Larson said: [snip] It's seeing the - as a range identifier, escape it to get the literal hyphen. How about this: [a-zA-Z0-9_\-.]* In my tests, the period didn't need to be escaped with the \.

Re: [PHP] Ereg sass

2003-03-18 Thread CPT John W. Holmes
If you want to look for a dash (-), you always place it last in the brackets, other wise the regex machine will be looking for a range. So just move the - to the last character. [A-Za-z0-9_.-]* ---John Holmes... - Original Message - From: Liam Gibbs [EMAIL PROTECTED] To: php list [EMAIL

Re: [PHP] ereg usage

2003-02-16 Thread Ernest E Vogelsinger
At 16:18 16.02.2003, Peter Gumbrell said: [snip] Could someone please tell me why this code is not working: ereg ('^[A-H]*([0-9]+)-$', $rank, $matches); $workshop_ID = $matches[1][2}; where $rank is something like C12-1 and I just need the C12 part.

Re: [PHP] ereg usage

2003-02-16 Thread Rick Emery
The problem is that it's looking for hyphen, - , immediately preceeding the end. Remove the $. - Original Message - From: Peter Gumbrell [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Sunday, February 16, 2003 9:18 AM Subject: [PHP] ereg usage Could someone please tell me

Re: [PHP] ereg.

2002-12-18 Thread Wico de Leeuw
^ is not in this case Try if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) { Added the $ at the end else the could be more then 20 chars Greetz At 17:20 18-12-02 +0100, Anders Thoresson wrote: What's wrong with the following regular expression? As far as I can se, only alphabetic

Re: [PHP] ereg.

2002-12-18 Thread Wico de Leeuw
At 17:26 18-12-02 +0100, Wico de Leeuw wrote: ^ is not in this case Cancel that, i don't think thats true anyway if(!ereg(^[a-zA-ZåÅäÄöÖ]{4,20}\$, $_REQUEST['f_name'])) { Should work i think Gr, Try if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) { Added the $ at the end else

Re: [PHP] ereg.

2002-12-18 Thread 1LT John W. Holmes
- From: Wico de Leeuw [EMAIL PROTECTED] To: Anders Thoresson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, December 18, 2002 11:26 AM Subject: Re: [PHP] ereg. ^ is not in this case Try if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) { Added the $ at the end else the could

Re: [PHP] ereg.

2002-12-18 Thread liljim
; [EMAIL PROTECTED] Sent: Wednesday, December 18, 2002 11:26 AM Subject: Re: [PHP] ereg. ^ is not in this case Try if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) { Added the $ at the end else the could be more then 20 chars Greetz At 17:20 18-12-02 +0100, Anders Thoress

Re: [PHP] Ereg help

2002-10-25 Thread Rick Emery
?php $s = #12-3456 The Item description $35.43; $qq = ereg(#([0-9]*-[0-9]*) ([a-zA-Z0-9 ]*) \\$([0-9]{1,3}\.[0-9]{2}), $s,$a); $val = $a[1]./.$a[2]./.$a[3]; print $val; ? - Original Message - From: William Glenn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 25, 2002

RE: [PHP] ereg() not matching same text each time script is run...

2002-04-23 Thread John Holmes
Someone gave me the preg_match equivalent preg_match( '/([-_a-z]+)\.([a-z]+)$/i', $row['site'], $match2 ); I tried that and it took care of the problem, as far as I can tell. To me, that narrows it down to a problem (bug?) with ereg... anyone else have any ideas? ---John Holmes...

Re: [PHP] Ereg ()

2002-04-16 Thread Erik Price
On Tuesday, April 16, 2002, at 08:49 AM, [EMAIL PROTECTED] wrote: I'm new with RegEx and I would like to use them to validate my forms entries submitted to the server. My question is how can I verify with the regex that a string is - at least 7 chars - contains Chars and Nums - may

Re: [PHP] Ereg ()

2002-04-16 Thread DrouetL
] Subject: Re: [PHP] Ereg () 16/04/02 15:44

Re: [PHP] Ereg ()

2002-04-16 Thread Erik Price
On Tuesday, April 16, 2002, at 09:51 AM, [EMAIL PROTECTED] wrote: Thanks for this answer. But how can i test if i actually have numbers AND letters ? preg_match('/([A-Za-z].*[\d]|[\d].*[A-Za-z]/', $string); Untested, but in theory should work. On Tuesday, April 16, 2002, at 08:49

Re: [PHP] ereg-digits only...

2002-02-12 Thread val petruchek
if ((int($string)==($string)) ($string0)) {then positive integer} not sure exactly, but try Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: B. Verbeek [EMAIL PROTECTED] To: Php-Db-Help (E-mail) [EMAIL

Re: [PHP] ereg-digits only...

2002-02-12 Thread * RzE:
if ((int($string)==($string)) ($string0)) {then positive integer} not sure exactly, but try Why not use the RE's? I usually use preg_* so I'll give the example using these... if (preg_match (/^\d+$/, $string)) { print (Yep... Only digits.); } else { prnt (Noop! There are non-digit

RE: [PHP] ereg-digits only...

2002-02-12 Thread Daniel Kushner
] Cc: PHP Subject: Re: [PHP] ereg-digits only... if ((int($string)==($string)) ($string0)) {then positive integer} not sure exactly, but try Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From

Re: [PHP] ereg-digits only...

2002-02-12 Thread val petruchek
] - Original Message - From: Daniel Kushner [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: PHP [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 4:00 PM Subject: RE: [PHP] ereg-digits only... That wouldn't work! 1) You meant to write: if (((int)$string==$string

Re: [PHP] ereg-digits only...

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 03:04, B. Verbeek wrote: How do I check a string for it to only contain numbers? if(!ereg(([0-9]+),$string)){ print It contains characters other than numbers; }else{ print Only numbers; } Can anyone give some feedback...

RE: [PHP] ereg et all

2002-01-31 Thread Rick Emery
try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg et all hi, is there a simple way to replace an occurence

Re: [PHP] ereg et all

2002-01-31 Thread Edward van Bilderbeek - Bean IT
that is not what I meant... I want the cases to remain... - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:47 PM Subject: RE: [PHP] ereg et all try: eregi_replace

Re: [PHP] ereg et all

2002-01-31 Thread Jeff Sheltren
[EMAIL PROTECTED] To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:47 PM Subject: RE: [PHP] ereg et all try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean

Re: [PHP] ereg et all

2002-01-31 Thread Edward van Bilderbeek - Bean IT
PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff At 10:52 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: that is not what I meant... I want the cases to remain

Re: [PHP] ereg et all

2002-01-31 Thread Jeff Sheltren
] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED

Re: [PHP] ereg et all

2002-01-31 Thread Edward van Bilderbeek - Bean IT
: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have

Re: [PHP] ereg et all - new question..

2002-01-31 Thread Edward van Bilderbeek - Bean IT
? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't

Re: [PHP] ereg et all - new question..

2002-01-31 Thread Richard Crawford
? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now

Re: [PHP] ereg et all - new question..

2002-01-31 Thread Richard Crawford
IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have

Re: [PHP] ereg et all - new question..

2002-01-31 Thread Edward van Bilderbeek - Bean IT
PROTECTED] Sent: Thursday, January 31, 2002 11:20 PM Subject: Re: [PHP] ereg et all - new question.. Seems like that makes it a LOT easier. Use eregi_relace() instead of ereg_replace(). eregi allows for case-insensitivity. Try eregi_replace(this,b\\1/b,$str); That should do it, though I

Re: [PHP] ereg et all - new question..

2002-01-31 Thread Richard Crawford
- Original Message - From: Richard Crawford [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:20 PM Subject: Re: [PHP] ereg et all - new question.. Seems like that makes it a LOT easier. Use

Re: [PHP] ereg

2002-01-10 Thread Jimmy
Hi Kunal, ereg(!--start--(.*)!--stop--, $lineofhtml, $output); ereg(!--start--([^!--stop--]*)!--stop--, $lineofhtml, $output); -- Jimmy It's not what you have in your life that counts, but who you have in your life -- PHP General Mailing List

Re: [PHP] ereg

2002-01-10 Thread Kunal Jhunjhunwala
Nopes, dint work Regards, Kunal Jhunjhunwala - Original Message - From: Jimmy [EMAIL PROTECTED] To: Kunal Jhunjhunwala [EMAIL PROTECTED] Cc: php-list [EMAIL PROTECTED] Sent: Friday, January 11, 2002 9:30 AM Subject: Re: [PHP] ereg Hi Kunal, ereg(!--start--(.*)!--stop--, $lineofhtml

Re: [PHP] ereg

2002-01-10 Thread Kunal Jhunjhunwala
: [PHP] ereg what about ? ereg(!--start--(.*?)!--stop--, $lineofhtml, $output); -Original Message- From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 3:05 PM To: Jimmy Cc: php-list Subject: Re: [PHP] ereg Nopes, dint work

RE: [PHP] ereg

2002-01-10 Thread Rasmus Lerdorf
[mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 3:05 PM To: Jimmy Cc: php-list Subject: Re: [PHP] ereg Nopes, dint work Regards, Kunal Jhunjhunwala - Original Message - From: Jimmy [EMAIL PROTECTED] To: Kunal Jhunjhunwala [EMAIL PROTECTED] Cc: php-list [EMAIL PROTECTED

Re: [PHP] ereg help

2001-12-03 Thread Jim
This is a good starter about PHP and regular expressions. http://www.phpbuilder.com/columns/dario19990616.php3 - Original Message - From: Valentin V. Petruchek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:35 PM Subject: [PHP] ereg help I'm not new for

Re: [PHP] ereg help

2001-12-03 Thread J Smith
Something like this will work: eregi(^id \{([a-z]*),([a-z]+),([a-z]+)\} \[(.+)\]$, $str, $regs); $regs will be an array containing: [0] = id {name,title,nick} [http://www.php.net]; [1] = name [2] = title [3] = nick [4] = http://www.php.net; If course this isn't very foolproof or generic. For

Re: [PHP] ereg checking if its only numbers

2001-10-05 Thread Rasmus Lerdorf
http://php.net/is_numeric On Fri, 5 Oct 2001, Chris Aitken wrote: Ive been playing around with ereg for about half an hour and having no joy because I dont really understand the medhod behind it and how it all works. But what im trying to do is check to see if a 9 digit string is all

Re: [PHP] ereg checking if its only numbers

2001-10-05 Thread _lallous
That's not regexps Rasmus! :) I always see you referring us the the manual! sometimes you refer to a function i never say in my life! ;) Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://php.net/is_numeric On Fri, 5 Oct 2001, Chris Aitken

RE: [PHP] ereg checking if its only numbers

2001-10-04 Thread Jack Dempsey
if(!preg_match(/^\d+$/,$string){ echo $string has something other than a number; } -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 9:34 PM To: PHP General Mailing List Subject: [PHP] ereg checking if its only numbers Ive been

RE: [PHP] ereg checking if its only numbers

2001-10-04 Thread Maxim Maletsky \(PHPBeginner.com\)
Mailing List Subject: RE: [PHP] ereg checking if its only numbers if(!preg_match(/^\d+$/,$string){ echo $string has something other than a number; } -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 9:34 PM To: PHP General

Re: [PHP] ereg checking if its only numbers

2001-10-04 Thread Evan
try: ? if(ereg([0-9]{9}, $string)){ echo Success, 9 numbers!; } else { echo Failure, not 9 numbers.; } ? There is a great book on regular expressions by o'reily. Evan *** REPLY SEPARATOR *** On 10/5/01 at 11:33 AM Chris Aitken wrote: Ive been playing around

Re: [PHP] ereg

2001-09-30 Thread ReDucTor
use MSIE:[56|5\..|6\..] something like that, i suck at regular expression :D - Original Message - From: Matthew Delmarter [EMAIL PROTECTED] To: PHP Mailing List [EMAIL PROTECTED] Sent: Monday, October 01, 2001 1:32 PM Subject: [PHP] ereg How do I use ereg to check for MSIE 5.5 and

Re: [PHP] ereg question

2001-09-02 Thread Papp Gyozo
Hello, check it in the manual: http://www.php.net/manual/en/function.ereg.php If you don't pass the third -- optional -- argument, then it's true. Otherwise not. I don't know this book, but you may keep in my mind that PHP is evolving, so the online manual can be its most up-to-date

Re: [PHP] ereg()

2001-08-28 Thread Jack Dempsey
You could try fgets from the fp instead of fread. Then for each line depending on how well structured it is you have a variety of options, but i think this would be at least a good start: www.php.net/preg_split - split on multiple spaces - \s+ jack Ben Quinn wrote: Hi all Say i had text

Re: [PHP] ereg() help, plz

2001-07-15 Thread Thomas R. Powell
Try this, while ($file_name = readdir($dir2)) { if ($file_name!=. $file_name!=.. $file_name!=head.jpg !ereg(^tn_,$file_name)) { $files[]=$file_name; } } $numfiles = count($files); for ($i=$g; $i$numfiles; $i++){ echo $files[$i]; } Tom At 09:45 PM 7/14/01 -0400, you wrote: hi, I wanna

Re: [PHP] ereg parse error problem

2001-07-12 Thread Philip Murray
Hi Lara, The problem isn't with the if(ereg) line, its the line above. Put a semi-colon at the end of your $string = ..[snip].. line Cheers - -- - - - Philip Murray - Senior Systems Engineer [EMAIL PROTECTED] - Open2View.com http://www.open2view.com

Re: [PHP] ereg questions

2001-05-24 Thread Dan Lowe
=anything.html ? i mean.. something like it got lots of subdirectories or not. Thanks - Original Message - From: Mark Maggelet [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 24, 2001 1:19 AM Subject: Re: [PHP] ereg questions On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben

Re: [PHP] ereg questions

2001-05-24 Thread Ker Ruben Ramos
: Thursday, May 24, 2001 5:18 PM Subject: Re: [PHP] ereg questions Previously, Ker Ruben Ramos said: hmm, got a little question. 1. what's that \\1 and \\2? got any info on where u got that from? Expands to whatever the parentheses surrounded during the match. So in this case you have

Re: [PHP] ereg function

2001-05-24 Thread CC Zona
In article 002e01c0e46c$ec2459a0$6e00a8c0@webdesign, [EMAIL PROTECTED] (Jay Paulson) wrote: echo ereg(^[a-zA-Z]$, $fname); as you can see I'm just looking to make sure the variable $fname just has characters a-zA-Z and nothing else. Actually, you're checking whethere the variable is a

Re: [PHP] ereg questions

2001-05-23 Thread Ker Ruben Ramos
] Sent: Thursday, May 24, 2001 1:19 AM Subject: Re: [PHP] ereg questions On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos ([EMAIL PROTECTED]) wrote: How do i change all 'a href=anything/here.html' to 'a href=file.php?file=anythinghere.php' any help out there? I would go: $string

RE: [PHP] ereg issues

2001-05-10 Thread ..s.c.o.t.t.. [gts]
print preg_replace('/(.*?)(\w{2})(.*)/', '\\2', $blah); works for: $blah = *9 scott 777zxsdf; and $blah = scott; -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Subject: [PHP] ereg issues I'm feeling a bit stupid today how do I truncate a string to the first two

RE: [PHP] ereg issues

2001-05-10 Thread scott [gts]
oh yeah. sorry... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack Dempsey Sent: Thursday, May 10, 2001 3:15 PM To: ..s.c.o.t.t.. [gts] Cc: Php-General Subject: Re: [PHP] ereg issues isn't a \w a word character, meaning a-zA-Z_0-9

Re: [PHP] ereg issues

2001-05-10 Thread Jack Dempsey
] Cc: Php-General Subject: Re: [PHP] ereg issues isn't a \w a word character, meaning a-zA-Z_0-9 (in perl)? if so, that wouldn't match the a-zA-z he originally intended... am i missing something? -jack ..s.c.o.t.t.. [gts] wrote: print preg_replace('/(.*?)(\w{2})(.*)/', '\\2

RE: [PHP] ereg issues

2001-05-10 Thread Jerry Lake
To: scott [gts] Cc: Php-General Subject: Re: [PHP] ereg issues print preg_replace('/^(.*?)([a-zA-Z]{2})(.*)/','\\2',$blah); try that -jack scott [gts] wrote: oh yeah. sorry... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack Dempsey Sent

  1   2   >