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

[PHP] ereg help!

2008-01-08 Thread steve
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 of website.html

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

[PHP] ereg() problem

2007-01-30 Thread jekillen
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); testing $route I get: $route = $m[1]; print $route.'br'; jk/in' rec='a_378e6dc4.xml' / (out put of print) jk is all I am looking for but is

[PHP] Ereg problem

2006-06-27 Thread Beauford
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 in a function and $_POST['password1'] is passed to

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

[PHP] ereg function

2004-12-31 Thread Michael Lutaaya
I want to validate someones age. How do I do this in the ereg function. I also have some visitors on my site who are in between the ages of 7-9 so don't forget to make them part of the ereg function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

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'])

[PHP] ereg question/prob...

2004-07-15 Thread bruce
hi... i have the following... $file = .txt; ereg((\.)([a-z0-9]{3,5})$, $file, $regs); echo ww = .$regs. brbr; i'm trying to figure out how to get the portion of the regex that's the extension of the file. my understanding of the docs, says that the extension should be in the $reg

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

2004-04-14 Thread -{ Rene Brehmer }-
I'm trying to do graphical smileys for my guestbook, but I've run into a problem with the crying smilies: I need to replace :'( and :'-( ... or as they look in the post after being entered through htmlentities with ent_quotes on: :#039;( :#039;-( this causes the entire message to disappear:

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()

[PHP] Ereg problems

2004-03-25 Thread Jeff McKeon
Having some problems with ereg() [begin code] $string=Credit adjusted: $-1.32 to $48.68 ereg(([\\$(\\$-)][0-9]+\.[0-9]+),$data[2],$found); While(list($index,$hits)=each($found)) { echo $index , $hitsbr; } [end code] Returns 0 ,

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 (ereg(^[a-bA-B][a-bA-B0-9]{3,11

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 [

[PHP] ereg + performance problem

2004-01-01 Thread Martin Helie
Hello, I'm writing a routine that recursively reads an HTML document, looking for special tags. It's a template system, but contrary to what I've seen out there so far, no template engines allow for any kind of customization from within the document; they only seem to be variable replacement

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

[PHP] ereg is failing on this simple test

2003-12-12 Thread Manuel Ochoa
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; } I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be appreciated.

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

[PHP] ereg

2003-09-12 Thread alexander sundli
I use this expression to remove oneline comments: iereg_replace(//([^\n]*)\n,'',$code); I need to make a check if this expression is inside a string. If it is, its not a comment. I think it has something to do with context.. Anyone who could help me? thanx -- PHP General Mailing List

[PHP] ereg preg

2003-08-15 Thread Eddy-Das
is there any syntax difference between ereg() and preg() except preg needs / and /? -- - Eddy Wong __ inframatrix internet solutions http://www.inframatrix.com/ ¥¿¤KEddy Regular Octa-Eddy [EMAIL PROTECTED]@ [EMAIL PROTECTED]@¡½¢ª¢© [EMAIL PROTECTED]@[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

[PHP] ereg() can't recognize characters such as èéêë...

2003-07-29 Thread Ivo Fokkema
Hi list, I read through the manual and tried to find something on google, but I didn't come to anything useful. It seems that the ereg()-family (I tried ereg(), eregi() and ereg_replace()) can't recognize any special characters such as èéêë etc. I tested this : ?php print

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)

[PHP] ereg problem?

2003-07-24 Thread chenqi1
who can tell me what's the pattern string mean. if(ereg([\\][n],$username)) { /*Do err*/ } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

[PHP] Ereg question

2003-03-30 Thread Beauford
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})$, $formsave[dob],

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

[PHP] Ereg sass

2003-03-18 Thread Liam Gibbs
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 The same goes for [A-Za-z0-9_-\.]* Anyone know why?

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: [A-Za-z0-9_

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
PROTECTED] Sent: Tuesday, March 18, 2003 3:33 AM Subject: [PHP] Ereg sass 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 The same goes

[PHP] ereg usage

2003-02-16 Thread Peter Gumbrell
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. Many thanks Peter Gumbrell [EMAIL PROTECTED] -- PHP General Mailing List

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

[PHP] ereg.

2002-12-18 Thread Anders Thoresson
What's wrong with the following regular expression? As far as I can se, only alphabetic characters including the special swedish ones, should be let through, but whatever character passed on in $_REQUEST['f_name'] passes the test? if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {

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

[PHP] Ereg headache: got an Aspirin

2002-11-21 Thread Mako Shark
Finally, I found y answer to my ereg/grep question. Thanks to all those who took a stab at it. You led me to the answer. For all those interested in reg-parsing comma-delimited lists, here is what I searched for: '^INPUT TYPE = \HIDDEN\ NAME = \numbers\ VALUE = \[0-9,\]*[\,] . $numbertosearch .

[PHP] Ereg headache

2002-11-15 Thread Mako Shark
I have a real problem that I can't seem to figure out. I need an ereg pattern to search for a certain string (below). All this is being shelled to a Unix grep command because I'm looking this up in very many files. I've made myself a INPUT TYPE=HIDDEN tag that contains in the value attribute a

[PHP] ereg (Why, Does sort of work)?

2002-11-02 Thread David Jackson
I'm comparing the values of a check box, against another form field, and it sort of works, but I don't understand why (A better solution? is listed below it? TIA, David Jackson --- And part of the HTML Form: --- tdbAccount Type:/b/td

[PHP] Ereg help

2002-10-25 Thread William Glenn
Hey all, I've been fighting this all night, I need a bit of help. I have a string like. #21-935 Item Description: $35.95 Where the part # could be 10-2034 a combination of 2 and 3 or 4 digits, and the price could be a combination of 1,2,3 . 2 digits. I want to chop that string into Part # /

Re: [PHP] Ereg help

2002-10-25 Thread Rick Emery
:34 AM Subject: [PHP] Ereg help Hey all, I've been fighting this all night, I need a bit of help. I have a string like. #21-935 Item Description: $35.95 Where the part # could be 10-2034 a combination of 2 and 3 or 4 digits, and the price could be a combination of 1,2,3 . 2 digits. I want to chop

[PHP] Ereg Help

2002-10-25 Thread David Pratt
Hi William, try this: ^(#[0-9]{2}-[0-9]{2,4} Item Description: [\$][0-9]{1,3}[\.][0-9]{2})$ I've just been putting a number of expressions together for validation myself. Regards, Dave Pratt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] ereg

2002-05-02 Thread Jason Soza
Hoping someone can help me here. I'm working with someone else's code and I'm not familiar with ereg_replace(), can someone provide me an alternative to the following? ereg_replace([^a-z0-9._], , ereg_replace ( , _, ereg_replace(%20, _, strtolower($original_name; Basically, I want to enter

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

2002-04-23 Thread John Holmes
Okay...I'm really at a loss for this... (PHP 4.0.6 on Redhat Linux) I've written a little script that shows the top referrers for http://www.falkware.com. Problem is...the script is supposed to take www.domain.com and strip out only the domain to show. It does this, but only some of the time.

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

2002-04-23 Thread John Holmes
... -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:01 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg() not matching same text each time script is run... Okay...I'm really at a loss for this... (PHP 4.0.6 on Redhat Linux) I've written a little

[PHP] ereg size limit???

2002-04-21 Thread SP
I am trying to validate my input with ereg but I get the error Warning: REG_BADBR when I try over 255 characters. Is there anyway around this? Works = if(eregi('^[A-Za-z]{1,255}$', test sentence)) echo valid input; Doesn't Work if(eregi('^[A-Za-z]{1,256}$', test sentence))

[PHP] Ereg ()

2002-04-16 Thread DrouetL
Hi, 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 contains some special chars (ex : % ! : ; , )but not in first or last

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

[PHP] ereg-digits only...

2002-02-12 Thread B. Verbeek
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... regards, Bart -- PHP General Mailing List (http://www.php.net/) To

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

2002-02-12 Thread val petruchek
PROTECTED]; Php-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 1:04 PM Subject: [PHP] ereg-digits only... 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

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...

[PHP] ereg

2002-02-11 Thread Christoph Starkmann
Hi there! Is there any mean to tell PHP to use ereg etc. greedy? Thanx, Kiko - It's not a bug, it's a feature. [.nfq] christoph starkmann tel.: 0821 / 56 97 94 34 fax.: 0821 / 56 97 94 38 http://www.fh-augsburg.de/~kiko ICQ: 100601600 - -- PHP General Mailing List

[PHP] ereg et all

2002-01-31 Thread Edward van Bilderbeek - Bean IT
hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General

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

  1   2   >