Re: [PHP] Eregi error

2007-03-01 Thread Richard Lynch
On Thu, March 1, 2007 6:14 pm, Myron Turner wrote: > Roberto Mansfield wrote: >> Myron Turner wrote: >> >>> M.Sokolewicz wrote: >>> >>$pattern = '^[a-z0-9\!\_ \.- ,/]*$'; >>if(!eregi($pattern, $input)){ >> >>> the problem is that the hyphen is interpreted as rege

Re: [PHP] Eregi error

2007-03-01 Thread Myron Turner
Roberto Mansfield wrote: Myron Turner wrote: M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ the problem is that the hyphen is interpreted as regex range operator: [a-z0-9\!

Re: [PHP] Eregi error

2007-03-01 Thread Richard Lynch
On Wed, February 28, 2007 9:08 pm, Brad wrote: > I have been having some trouble with the "eregi" function. I have the > following piece of code in my application: > > function standard_input($input, $min=0, $max=50){ > if (strlen($input) <= $max and strlen($input) >= $min ) { >

Re: [PHP] Eregi error

2007-03-01 Thread Roberto Mansfield
Myron Turner wrote: > M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ > > the problem is that the hyphen is interpreted as regex range operator: > [a-z0-9\!\_ \.- ,/] > Rewrite this as >

Re: [PHP] Eregi error

2007-03-01 Thread Myron Turner
M.Sokolewicz wrote: Hey all, I have been having some trouble with the "eregi" function. I have the following piece of code in my application: function standard_input($input, $min=0, $max=50){ if (strlen($input) <= $max and strlen($input) >= $min ) { $pattern = '^[a-z0-9\!\

Re: [PHP] Eregi error

2007-03-01 Thread M.Sokolewicz
I agree with the first part, that it is in many cases better to use the Perl Compatible Regular Expressions (PCRE, preg_*) than the POSIX compatible ones (ereg[i]_*). However, I don't quite get what you mean by "extension is useless" ? What extension...?? and why would it be useless? (useless i

Re: [PHP] Eregi error

2007-03-01 Thread Nicholas Yim
Hello Brad, suggest to use preg_* instead of ereg_* extension is useless Best regards, === At 2007-03-01, 11:12:52 you wrote: === > >Hey all, >I have been having some trouble with the "eregi" function. I have the >following piece of code in my application: > >function sta

RE: [PHP] Eregi error

2007-02-28 Thread Peter Lauri
Not sure, but I don't think you should escape all those characters inside of the character class. I might be wrong. However, that might not have anything to do with the error. But I do think you need to escape the / in the end... And the - you should have in the beginning of the character class, ot

Re: [PHP] eregi problem

2005-04-03 Thread Josip Dzolonga
[EMAIL PROTECTED] wrote: if((eregi("[^a-zA-Z0-9]",$GP[sifre]) I think that the ^ anchor is your problem, it shall be out of the brackets : if (eregi("^[a-zA-Z0-9]+$", $GP['sifre'])) echo 'true'; else echo 'false'; (the above is tested and works perfect) P.S. Take a look here http://www.php.net/man

Re: [PHP] eregi problem

2005-04-03 Thread BAO RuiXian
[EMAIL PROTECTED] wrote: I m trying to check $GP[sifre] variable, $GP[sifre] must consist of alpha numeric chars only. here, how I check the variable: Try this: if(eregi("^[a-zA-Z0-9]+$",$GP[sifre])) The above say that between the beginning of the string "^" and the end of the string "

RE: [PHP] Eregi question

2004-03-11 Thread Dave Carrera
PROTECTED] Subject: Re: [PHP] Eregi question hi dave, try this: $temp = explode('.',$_POST['variable']); $domainname = $temp[1]; greetz da koenich > Hi List, > > I Know this is basic and I am sorry to bother the list with this > question but I am confused, probably

Re: [PHP] Eregi question

2004-03-11 Thread Jason Wong
On Thursday 11 March 2004 22:50, Dave Carrera wrote: > I want to end up with a part of a string returned by $_POST to work with in > my function. > > The string might be put into the text box like so, it’s a domain name > checker, > > http://www.domainname.com > > I have already got rid of the htt

Re: [PHP] Eregi question

2004-03-11 Thread Da Koenich
hi dave, try this: $temp = explode('.',$_POST['variable']); $domainname = $temp[1]; greetz da koenich > Hi List, > > I Know this is basic and I am sorry to bother the list with this question > but I am confused, probably working to hard :-) > > I want to end up with a part of a string returne

RE: [PHP] eregi filter stopping valid email address, part two

2004-01-06 Thread Dave G
Mike, > No. You've only allowed for hyphens in the first element > after the @ sign > -- this address has them in the 2nd element. Ah, yes, I guess I had it that way because there are no hyphens in top level domain designations, but hadn't accounted for the fact that it would exclude them if th

Re: [PHP] eregi filter stopping valid email address, part two

2004-01-06 Thread CPT John W. Holmes
From: "Dave G" <[EMAIL PROTECTED]> > A while ago on this list I posted a few questions about an eregi > filter for email addresses entered into a form. With the help of people > on this list, I settled on the following code which has worked fine in > the months since I started using it. The code i

RE: [PHP] eregi filter stopping valid email address, part two

2004-01-06 Thread Ford, Mike [LSS]
On 06 January 2004 15:53, Dave G wrote: > PHP Gurus > > A while ago on this list I posted a few questions about an eregi > filter for email addresses entered into a form. With the help > of people > on this list, I settled on the following code which has worked fine in > the months since I

[PHP] Re: PHP eregi filtering problem

2003-12-08 Thread Sven
Purpleonyx schrieb: Greetings all, I ran into a problem today and was hoping someone could provide an answer. I am fetching a web page, and attempting to parse certain variables from it. I've done this plenty of times in the past with no problem. The only difference this time is the file that I a

Re: [PHP] eregi function?

2003-11-26 Thread Jason Wong
On Wednesday 26 November 2003 06:32, Jas wrote: > Not sure how to do this but I have a call to a database which pulls the > contents of a table into an array and I need a eregi string which will > sift through the contents and put a line break (i.e. \n or ) after > each ";", "}" or "{". If that

Re: [PHP] eregi function?

2003-11-25 Thread John W. Holmes
Jas wrote: Not sure how to do this but I have a call to a database which pulls the contents of a table into an array and I need a eregi string which will sift through the contents and put a line break (i.e. \n or ) after each ";", "}" or "{". here is what I have so far... function callback(&$v

RE: [PHP] eregi function?

2003-11-25 Thread Chris W. Parker
Jas on Tuesday, November 25, 2003 2:32 PM said: > Not sure how to do this but I have a call to a database which pulls > the contents of a table into an array and I need a eregi string which > will sift through the contents and put a line break (i.e. \n or ) > after e

Re: [PHP] eregi filter

2003-11-18 Thread John Nichel
John W. Holmes wrote: Derek Ford wrote: Erin wrote: > > > Anyone have a good eregi filter for passwords? well, for one thing, don't use ereg. Use pcre, as it is faster. preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah); that will validate a password containing only upper or lowercase letters and numb

Re: [PHP] eregi filter

2003-11-18 Thread John W. Holmes
Derek Ford wrote: Erin wrote: > > > Anyone have a good eregi filter for passwords? well, for one thing, don't use ereg. Use pcre, as it is faster. preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah); that will validate a password containing only upper or lowercase letters and numbers, between 5 and 16 cha

Re: [PHP] eregi filter

2003-11-18 Thread John W. Holmes
Erin wrote: Anyone have a good eregi filter for passwords? Yes. http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.c

Re: [PHP] eregi filter

2003-11-18 Thread Derek Ford
Erin wrote: Anyone have a good eregi filter for passwords? Regards R well, for one thing, don't use ereg. Use pcre, as it is faster. preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah); that will validate a password containing only upper or lowercase letters and numbers, between 5 and 16 characters.

Re: [PHP] Eregi filtering..

2003-07-07 Thread Mike Migurski
>elseif (eregi("a-ZA-9", $v_tel_filter)) { >echo "'$v_tel_filter' Telephone Number Contains words"; > >} else { > >im looking how to verify numbers alone and dash "-" can that be possible? I >have tried using "a-ZA-9" but did not work. /^[\-\d]+$/ should match a string of just digits and dashes.

RE: [PHP] Eregi filtering..

2003-07-07 Thread Miranda, Joel Louie M
27;ll check on the syntax for strrpos, thanks! -- Thank you, Louie -Original Message- From: Ralph [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 8:20 AM To: Miranda, Joel Louie M; [EMAIL PROTECTED] Subject: RE: [PHP] Eregi filtering.. Here is one of doing this: if(strrpos

RE: [PHP] Eregi filtering..

2003-07-07 Thread Ralph
Here is one of doing this: if(strrpos($v_tel_filter,' ') > 0 || strspn($v_tel_filter, "0123456789-") != strlen($v_tel_filter)){ echo "'$v_tel_filter' Telephone Number Contains words"; } else { } -Original Message- From: Miranda, Joel Louie M [mailto:[EMAIL PROTECTED] Sent: Mo

Re: [PHP] eregi problems

2002-07-04 Thread Marek Kilimajer
If the regexp matches, it is a valid email, so you need ! in front of it. dan radom wrote: >I've got a form that's posted to a php page where I'm attempting to validate a field >contains a valid email address. The eregi below seems to be totally ignored... > > if (eregi("^[a-z0-9\._-]+@[a

Re: [PHP] eregi problems

2002-07-04 Thread dan radom
My main cnocern at this point is that the eregi is being totally ignored. I just want to make sure the email address is in a valid format, not that it is a valid email address. I'll look at validEmailFormat as well, but I don't understand why it's not even being examined. dan * Justin Fren

Re: [PHP] eregi problems

2002-07-04 Thread Justin French
Dan, I'll give you a little piece of advise that was given to me a little while back on this list: Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat program. PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program from O'Reilly's Mastering Regular Exp

Re: [PHP] eregi not working

2002-06-07 Thread Jason Wong
On Saturday 08 June 2002 10:48, Robert Packer wrote: > Can someone tell me why this isn't working? To me it say open the file, > read it, stick into a variable, close the file. Then search that variable > (the file) and look for the eregi statements. Can someone tell me why this > only gets the fi

Re: [PHP] eregi() against a binary file?

2002-05-29 Thread Miguel Cruz
According to the manual, the ereg functions are not binary safe. The superior-in-every-way preg functions are. Perhaps you could try using preg_grep instead. $result = preg_grep('/' . preg_quote($imagename) . '/', $file); You may find that strstr or something is even simpler. miguel On Tue,

Re: [PHP] eregi(mail)

2002-05-21 Thread Miguel Cruz
On Tue, 21 May 2002, Denis L. Menezes wrote: > I use the following code, but it does not work. Is there something wrong? > > If > (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a > -z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', > $email_address)) One problem (syn

Re: [PHP] eregi(mail)

2002-05-21 Thread Denis L. Menezes
address)) ){ Print ("Sorry, the email address seems to be invalid."); exit; } Please help. Denis - Original Message - From: "Steve Buehler" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]> Cc: "PHP" <[EMAIL PROTECTED]&

Re: [PHP] eregi(mail)

2002-05-16 Thread Liam Gibbs
Thanks to all who helped out with the eregi(mail) stuff. I got my problem solved, and on top of that, there were some bugs that I found in the code. Thanks again to everyone. __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yah

Re: [PHP] eregi(mail)

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Kevin Stone wrote: > As we all know ARPA is thet university network, funded by the government > to build an information infrastructure that eventually became the > internet we have today. But the standards for text messaging within the > ARPA net have been added to over the y

RE: [PHP] eregi(mail)

2002-05-10 Thread Nathan Cassano
This is what I have used. Here is an excellent article on Regular Expressions. Learning to Use Regular Expressions by Example http://www.phpbuilder.com/columns/dario19990616.php3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] eregi(mail)

2002-05-10 Thread Kevin Stone
e address is sendable, in which case the string format is irrelevant. -Kevin - Original Message - From: "Miguel Cruz" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]> Cc: "PHP-general" <[EMAIL PROTECTED]> Sent: Friday, May 10, 200

Re: [PHP] eregi(mail)

2002-05-10 Thread Steve Buehler
To tell you the truth, I can't read it. Steve At 01:32 PM 5/10/2002, Miguel Cruz wrote: >On Fri, 10 May 2002, Steve Buehler wrote: > > > >if(ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', > > > >If I'm reading it

Re: [PHP] eregi(mail)

2002-05-10 Thread Steve Buehler
>[EMAIL PROTECTED] > > >- Original Message - >From: "Analysis & Solutions" <[EMAIL PROTECTED]> >To: "PHP List" <[EMAIL PROTECTED]> >Sent: Friday, May 10, 2002 10:59 AM >Subject: Re: [PHP] eregi(mail) > > > > Hi L

Re: [PHP] eregi(mail)

2002-05-10 Thread Analysis & Solutions
Folks: On Fri, May 10, 2002 at 01:27:45PM -0500, Steve Buehler wrote: > > >if(ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', > > $subarray)){ Those characters don't conform to the R

Re: [PHP] eregi(mail)

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Steve Buehler wrote: > >if(ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', > If I'm reading it correctly, this will let invalid addresses through. The domain component (after the @ sign) can only

Re: [PHP] eregi(mail)

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Kevin Stone wrote: > I had always been suspicious about email validators so I did a big long > search on Google about standard address formats. It turns out that aside > from the @ symbol emails have no standard format whatsoever. So ereg('@', > $email) is really the only fu

Re: [PHP] eregi(mail)

2002-05-10 Thread Steve Buehler
function check_input($array){ global $HTTP_REFERER; $valid = 1; if(gettype($array)=="array") { while (list($index, $subarray) = each($array) ) { if(ereg("required_", $index) && (($subarray == "") || ($subarray == " "))) {

Re: [PHP] eregi(mail)

2002-05-10 Thread Kevin Stone
pected. I hope it was useful in some tiny miniscule sort of way. :) -- Kevin Stone [EMAIL PROTECTED] - Original Message - From: "Analysis & Solutions" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Friday, May 10, 2002 10:59 AM Subject: Re

Re: [PHP] eregi(mail)

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Liam Gibbs wrote: > Does anyone have a decent eregi statement for > validating e-mail addresses? I've tried the ones on > the site, but there seems to be small bugs with each > of them. They tell me that [EMAIL PROTECTED] is an > invalid e-mail address. Well, it currently is

Re: [PHP] eregi(mail)

2002-05-10 Thread Analysis & Solutions
Hi Liam: On Fri, May 10, 2002 at 09:48:58AM -0700, Liam Gibbs wrote: > Does anyone have a decent eregi statement for > validating e-mail addresses? eregi('^[a-z0-9_.=+-]+@([a-z0-9-]+\.)+([a-z]{2,6})$', $Email); Enjoy, --Dan -- PHP classes that make web design easier SQ

Re: [PHP] eregi

2002-05-02 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Miguel Cruz) wrote: > On Thu, 2 May 2002, CC Zona wrote: > > [EMAIL PROTECTED] (Miguel Cruz) wrote: > >> preg_match("/{$start}(.*?)end/", $rf, my_var); > > > > Leave out the braces. > > Don't they get removed by the parser's handling of "doubl

Re: [PHP] eregi

2002-05-02 Thread Miguel Cruz
On Thu, 2 May 2002, CC Zona wrote: > [EMAIL PROTECTED] (Miguel Cruz) wrote: >> preg_match("/{$start}(.*?)end/", $rf, my_var); > > Leave out the braces. Don't they get removed by the parser's handling of "double-quoted" strings long before anything makes it to preg_match()? I almost always use

Re: [PHP] eregi

2002-05-02 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Miguel Cruz) wrote: > On Thu, 2 May 2002, Fredrik Arild Takle wrote: > > eregi("$start(.*)end", $rf, $my_var); > > > > And I want it to stop at the first presedence of $end, not the last (thats > > what this is doing). > > Try preg, which is f

Re: [PHP] eregi

2002-05-02 Thread Miguel Cruz
On Thu, 2 May 2002, Fredrik Arild Takle wrote: > eregi("$start(.*)end", $rf, $my_var); > > And I want it to stop at the first presedence of $end, not the last (thats > what this is doing). Try preg, which is faster and gives you more control (here the ? munificence operator). preg_match("/{$st

Re: [PHP] eregi() problem

2002-04-21 Thread Miguel Cruz
On Mon, 22 Apr 2002, Gregor Jaksa wrote: > if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"])) > echo "wrong char"; > > why does this always return "wrong char" no matter what value is in vpis_ime > ... i tried "blah", "242234" "bla242h" .. every single time i get "wrong > char". im using

Re: [PHP] eregi() problem

2002-04-21 Thread Danny Shepherd
Try: if (!eregi('^[a-z_\-]{0,}$', $_POST['vpis_ime'])) echo "wrong char"; That'll sort it for everything except [ and ], which I can't find any way of checking for :-( Anyone else have any ideas? HTH anyway. Danny. - Original Message - From: "Gregor Jaksa" <[EMAIL PROTECTED]> To: <[

Re: [PHP] eregi() problems...

2002-04-16 Thread Michael Virnstein
the rest seems ok to me, if you search for files with e.g hello_.jpg as name "Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > eregi('_[0-9]{4}.jpg$', $file_name) > > should be > > eregi('_[0-9]{4}\.jpg$', $file_name) > > . is a spci

Re: [PHP] eregi() problems...

2002-04-16 Thread Michael Virnstein
eregi('_[0-9]{4}.jpg$', $file_name) should be eregi('_[0-9]{4}\.jpg$', $file_name) . is a spcial character(means every character) and has to be backslashed if you want it's normal meaning "Jas" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I must be

Re: [PHP] eregi() problems...

2002-04-15 Thread jas
I must be doing something wrong, for that solution did not work. "Robert Cummings" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > jas wrote: > > > > // second selection for main image on main page > > $dir_name = "/path/to/images/directory/"; > > $dir = opendi

Re: [PHP] eregi() problems...

2002-04-15 Thread Robert Cummings
jas wrote: > > // second selection for main image on main page > $dir_name = "/path/to/images/directory/"; > $dir = opendir($dir_name); > $file_lost .= " > "; > while ($file_names = readdir($dir)) { > if ($file_names != "." && $file_names !=".." && eregi('_[0-9]{4}.jpg$', > $file_name)) { >

Re: [PHP] eregi()

2002-03-19 Thread Rénald CASAGRAUDE
Vlad Kulchitski wrote: > > Hi, > > Can any1 send a small script of how to valiade a username using eregi(). > > I want username to consist only a-zA-Z1-0, "_", and "-" > > I can't get it to work correctly $pattern = "[a-zA-Z0-9_\-]+"; this is meaning : One word containing a-z or A-Z or 0-9 or

Re: [PHP] eregi, ereg or smth. else???

2002-02-26 Thread bvr
You don't need regular expressions for this. To match case insensitive, just upper or lower case both strings and use strpos() to find an occurence. Now you allready have the position of the match it'll be easy to get that part of the string. I suggest you substr() it into 3 parts and put the

Re: [PHP] eregi

2002-02-08 Thread DL Neil
Hello John > I'm using eregi to print out parts of a text file, and I was just wondering > how you get the code to print out a newline as it appears in the file. Not quite sure what eregi has to do with it - perhaps I'm missing something. Would the nl2br function help? =dn -- PHP General

Re: [PHP] eregi and alfa numeric characters.

2002-01-11 Thread Jimmy
Hi Sait, > no characters except for the followings will not be allowed. > 0-9 a-z A-Z ~ @ # $ % ( ) _ - + = [ ] { } < ? > if ( ereg("[^0-9a-zA-Z\_\-]", $user_input) ) { //invalid char detected } else { //input contain only allowed char } just add all your valid char in the pattern,

Re: [PHP] eregi

2001-10-02 Thread mike cullerton
on 10/2/01 8:51 AM, CC Zona at [EMAIL PROTECTED] wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Mike Cullerton) wrote: > >> eregi("^[a-z0-9_\-]+$",$string) >> >> notice that i had to escape the dash with a backslash > > Are you sure? 'Cuz AFAIK, escaping shouldn't be necessary

Re: [PHP] eregi

2001-10-02 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Mike Cullerton) wrote: > eregi("^[a-z0-9_\-]+$",$string) > > notice that i had to escape the dash with a backslash Are you sure? 'Cuz AFAIK, escaping shouldn't be necessary on a hyphen which is the last char (or, IIRC, the first) of a charac

Re: [PHP] eregi

2001-10-01 Thread mike cullerton
i realize a solution using strspn/strcspn was offered, but you asked for eregi :) anyway, i use ereg, but i think this should work eregi("^[a-z0-9_\-]+$",$string) notice that i had to escape the dash with a backslash the plus sign forces atleast one character. you can use {x,y} in place of the

Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine
Thankyou... I should have made it clearer that I did want to use only the legal characters to compare the string by. Tim "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Well, either you need to know the valid chars or the invalid ones. Make

Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf
Well, either you need to know the valid chars or the invalid ones. Make up your mind and use strspn() or strcspn() appropriately. -Rasmus On Mon, 1 Oct 2001, Tim Ballantine wrote: > "Returns the length of the initial segment of str1 which does not contain > any of the characters in str2." > >

Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine
"Returns the length of the initial segment of str1 which does not contain any of the characters in str2." I realise that i could see if this matches with the length of the entire word, and is there a way to get it to compare the word by the legal characters, because the amount of illegal symbols,

Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf
Huh? You better read that documentation page again. You only need to list the illegal symbols. And what do you mean by length? -Rasmus On Mon, 1 Oct 2001, Tim Ballantine wrote: > Is there anything which doesnt use length? And something like eregi, because > it would be infeasible to list all

Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine
Is there anything which doesnt use length? And something like eregi, because it would be infeasible to list all of the symbols that a user could use, to compare a string by. Tim "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > See php.net/strcs

Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf
See php.net/strcspn On Mon, 1 Oct 2001, Tim Ballantine wrote: > Hello, > > Could anyone tell me how to eregi a word, to see if it only contains either > numbers, letters, the "_" and the "-", so that any other symbol with call it > invalid. For example, theres the word "expressio_n" that will be

Re: [PHP] Eregi for Image

2001-08-26 Thread Daniel Rezny
Hello Jeff, Sunday, August 26, 2001, 9:17:45 PM, you wrote: JO> I want to check if an uploaded file is an image. This isn't working. JO> Could anyone help me out? JO> if (!eregi("\\.gif$", $img1_name) || JO> !eregi("\\.jpg$", $img1_name) || JO> !eregi("\\.jpeg$", $img1_name)) { JO>

RE: [PHP] EREGI -- Help

2001-05-16 Thread Johnson, Kirk
Give this a try: if(!ereg("^([0-9]{5}([-]{1}[0-9]{4})?)$",$data)) { Kirk > -Original Message- > From: Jason Caldwell [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 8:16 PM > To: [EMAIL PROTECTED] > Subject: [PHP] EREGI -- Help > > > I'm just trying to create a eregi expressi

Re: [PHP] eregi not working???

2001-03-20 Thread David Robley
On Wed, 21 Mar 2001 08:46, Clayton Dukes wrote: > > I have a script that looks for tags, but it doesn't seem to be > picking up the titles, can anyone tell me why? > > > Almost all of the web pages look like: > >if(!isset($mainfile)) { include("mainfile.php"); } > if(!isset($headers_sent))