PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 23rd, 2002, 11:23 AM
archamon archamon is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: KL, Malaysia
Posts: 8 archamon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
problem with preg_match()

hi,

i'm trying out some regular expressions to match a certain string.

when i try:

preg_match ("([0-9]|[a-z]|[A-Z]){6}[0-9]{12}",$commonname,$result);

i get the error:
Warning: Unknown modifier '{'

what does this mean? my guess is the {6} and {12} but aren't these valid regular expressions?

thanks.

Reply With Quote
  #2  
Old August 23rd, 2002, 07:09 PM
Taoism Taoism is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Winnipeg, MB, Canada
Posts: 81 Taoism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 2
RE: problem with preg_match()

you need to signal the start and end of a PCRE. Traditionally people use /

So:
php Code:
Original - php Code
  1.  
  2. <?php
  3. preg_match ("/([0-9]|[a-z]|[A-Z]){6}[0-9]{12}/",$commonname,$result);
  4. ?>


Cheers,
Keith.

Reply With Quote
  #3  
Old August 26th, 2002, 04:48 AM
archamon archamon is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: KL, Malaysia
Posts: 8 archamon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: problem with preg_match()

Hi CodeGirl,

With ereg it works fine, thanks a lot.


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > problem with preg_match()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway