[PHP] Re: ereg question/prob...

2004-07-15 Thread Red Wingate
$regs is an array not a string ! try print_r or var_dump to determine $regexp's content Tim Van Wassenhove wrote: In article <[EMAIL PROTECTED]>, Bruce wrote: $file = ".txt"; ereg("(\.)([a-z0-9]{3,5})$", $file, $regs); echo " ww = ".$regs. ""; i'm trying to figure out how to get the portion of

[PHP] Re: ereg question/prob...

2004-07-15 Thread Tim Van Wassenhove
In article <[EMAIL PROTECTED]>, Bruce wrote: > $file = ".txt"; > > ereg("(\.)([a-z0-9]{3,5})$", $file, $regs); > echo " ww = ".$regs. ""; > > > 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 > "ex

Re: [PHP] Re: Ereg problems

2004-03-26 Thread Curt Zirzow
* Thus wrote Jeff McKeon ([EMAIL PROTECTED]): > > > > > preg_match_all('($-?[0-9]+\.[0-9]+)', $string, $found); > > print_r($found); > > > > That produces: > > Array ( [0] => Array ( ) ) 0 , Array Sorry that should be: preg_match_all('/(\$-?[0-9]+\.[0-9]+)/', $string, $found); Curt --

RE: [PHP] Re: Ereg problems

2004-03-26 Thread Jeff McKeon
> -Original Message- > From: Curt Zirzow [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 6:55 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: Ereg problems > > > On Thu, 25 Mar 2004 18:31:02 -0500, Jeff McKeon > <[EMAIL PROTECTED]> > wro

[PHP] Re: Ereg problems

2004-03-25 Thread Curt Zirzow
On Thu, 25 Mar 2004 18:31:02 -0500, Jeff McKeon <[EMAIL PROTECTED]> wrote: 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))

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

2003-12-12 Thread Mike
it works if you remove the last $ from the expression, also I think the . needs escaping unless you have a special reason, use preeg_* as it is supposed to be quicker Mike Manuel Ochoa wrote: Why is this test failing? $data = "A Simple test."; If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) { ec

[PHP] Re: ereg

2003-09-12 Thread Dave Dash
I think this is a lot more complicated than somethign a simple regular expression can handle. You would need to do soemthign that reads the entire file, up until the first occurrence of your '//' and in the meantime do a count that checks to make sure all the quotes are closed. I'd be interested

[PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread DvDmanDT
Notice the ?... The ? after the * is at least supposed to stop that problem... So preg_replace("#\{(.*?),(.*?)\}#","\\2",$whatever); should do what you want... :p -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] "Ivo Fokkema" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTEC

Re: [PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread Curt Zirzow
* Thus wrote Ivo Fokkema ([EMAIL PROTECTED]): > Well d*mn, why didn't I think of this... It seems to work now! Thanks! > > I'm not such an expert on the Perl compatible regexp's so I rarely use > them... Yet another reason to start using them though... Its a good thing to learn perl regular expre

[PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread Ivo Fokkema
Well, I tried that first, but it failed when some user whould list multiple references. The ereg_replace would then take the two references as one. "{PMID11519736:Müller}, {PMID8789442:Milasin}" would result in a link to Müller named "Müller}, {PMID8789442:Milasin" instead of two separate links...

[PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread DvDmanDT
Also... You know, there's a (.*?) command as well.. Might work just about perfect in your situation... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] "Ivo Fokkema" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Well d*mn, why didn't I think of this... It seems to

[PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread DvDmanDT
What? Did it seriously help? You might be intrested in this regex then: preg_replace("#[a-z0-9\-\._îÎèéüÜÉÈáàÁÀäÄåÅöÖ]+#i",'',$VARIABLE); // Should hit most chars you want... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] "Ivo Fokkema" <[EMAIL PROTECTED]> skrev i meddelandet news:

[PHP] Re: ereg() can't recognize characters... [SOLVED]

2003-07-29 Thread Ivo Fokkema
Well d*mn, why didn't I think of this... It seems to work now! Thanks! I'm not such an expert on the Perl compatible regexp's so I rarely use them... Yet another reason to start using them though... Thanx! "Dvdmandt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Use preg_*() func

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

2003-07-29 Thread DvDmanDT
Use preg_*() functions then? Not that I think they would be much better but... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] "Ivo Fokkema" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Hi list, > > I read through the manual and tried to find something on google,

[PHP] Re: Ereg meadache

2002-11-18 Thread Mako Shark
<> . . . <> The problem with this is that I need to do it at the Linux level, or else I'm not saving PHP the trouble of searching through every file to find it. __ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting

[PHP] Re: Ereg headache

2002-11-15 Thread Gustaf Sjoberg
or.. if there can be only one instance of the number you can easily calculate it's position with strlen($numbers) and strpos($numbers, "1"); if strlen returns 5 and strpos 5 you'll know it was far right.. if strpos returns 1 and strlen >1 it's to the left.. and if strpos < strlen but not 1 it'

[PHP] Re: Ereg headache

2002-11-15 Thread Gustaf Sjoberg
hi, this is probably not at all what you want, but i wrote it just in case. if 1 is in the string it will return either "middle", "left", "right" or "only".. if it is not it will return false. On Fri, 15 Nov 2002 08:49:23 -0800 (PST) [EMAIL PROTECTED] (Mako Shark) wrote: >I have a real proble

[PHP] Re: Ereg help

2002-10-25 Thread Erwin
> "William Glenn" <[EMAIL PROTECTED]> wrote in message news:003101c27c3b$ff8c61a0$6401a8c0@;cortez.co.charter.net... > 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

RE: [PHP] Re: ereg size limit???

2002-04-22 Thread SP
ject: [PHP] Re: ereg size limit??? Hi, "Sp" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to validate my input with ereg but I get the error "Warning: > REG_BADBR" when I try over 255 characters. Is ther

[PHP] Re: ereg size limit???

2002-04-22 Thread liljim
Hi, "Sp" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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

[PHP] Re : Ereg ()

2002-04-16 Thread DrouetL
thanks to all of you for you help. regards Laurent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Ereg ()

2002-04-16 Thread Jas
If you look on php.net and run a search on ereg() you will find examples on how to use regex. Your string would look like this: ereg('[a-z][A-Z][0-9]{7}') With your special characters I am not sure how that would work but check out php.net. hth Jas -- PHP General Mailing List (http://www.php.

Re: [PHP] Re: Ereg/replace/i/ or something ??

2002-01-30 Thread Lars Torben Wilson
On Wed, 2002-01-30 at 08:16, liljim wrote: > Hi Bart, > > > I want to check the data from a form-field if it excists only of digits > > (0-9) and nothing else. > > > > How do I use the ereg()-function for this? > > Well, I prefer the preg_functions > > if (!preg_match("/^[0-9]{10}$/", $string))

[PHP] Re: Ereg/replace/i/ or something ??

2002-01-30 Thread liljim
Hi Bart, > I want to check the data from a form-field if it excists only of digits > (0-9) and nothing else. > > How do I use the ereg()-function for this? Well, I prefer the preg_functions if (!preg_match("/^[0-9]{10}$/", $string)) { // contains stuff other than numbers, or is less than 10 dig

[PHP] Re: Ereg/replace/i/ or something ??

2002-01-30 Thread J Smith
Try ereg("^[0-9]{10}$", $cust_tel); Quick explanation (I get the feeling you're new at regexes): ^ - beginning of string [0-9] - any number between 0 and 9 inclusive {10} - exactly ten times $ - end of string There ya go. J B. Verbeek wrote: > Hello, > > I want to check the data from a

[PHP] Re: ereg

2001-11-27 Thread lallous
I'm not sure if the ereg supports the inline greedy modifier like: .+? or .*? so: ereg("<\?php.*?\?\>", $html, $phpIncludes); if not use preg_match() instead... "Christoph Starkmann" <[EMAIL PROTECTED]> wrote in message B120D7EC8868D411A63D0050040EDA771118F3@XCHANGE">news:B120D7EC8868D411A63D

[PHP] Re: ereg expr guru

2001-10-02 Thread Richard Lynch
http://php.net/strtok -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Dave Vanauken <[EMAIL