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 [a-zA-Z] characters ?
 
 this sure isn't working
 snip
 $test = jerry;
 $test = ereg_replace(^\w*, ^[a-zA-Z]{2} ,$test);
 /snip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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 (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', $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 [a-zA-Z] characters ?
  
   this sure isn't working
   snip
   $test = jerry;
   $test = ereg_replace(^\w*, ^[a-zA-Z]{2} ,$test);
   /snip
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ereg issues

2001-05-10 Thread Jack Dempsey

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: 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 (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', $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 [a-zA-Z] characters ?
   
this sure isn't working
snip
$test = jerry;
$test = ereg_replace(^\w*, ^[a-zA-Z]{2} ,$test);
/snip
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] ereg issues

2001-05-10 Thread Jerry Lake

Cool, thanks

Jerry Lake
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
Dempsey
Sent: Thursday, May 10, 2001 12:39 PM
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: 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 (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', $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 [a-zA-Z] characters ?
   
this sure isn't working
snip
$test = jerry;
$test = ereg_replace(^\w*, ^[a-zA-Z]{2} ,$test);
/snip
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]