Here's my pattern based on your example.

 

'/[A-Z]{1,3}[0-9]{1,3}(-[0-9]{1,3})? /i'

 

I want to catch expressions that have 1-3 letters, followed by 1-3 digits.
The pattern should also match if same expression is followed by a - and 1-3
digits.

 

I have learned some more from this short query. Thanks a lot.

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark David Dumlao
Sent: Thursday, June 12, 2008 1:38 PM
To: Philippine Linux Users' Group (PLUG) Technical Discussion List
Subject: Re: [plug] Regex Help

 

some questions/ notes
1) is ABC123 the whole line? If not, ^ and $ are not needed.
2) It's not clear what expressions you plan to catch. Do you mean 1-3
letters (regardless of case), followed by 1-3 digits OR a range having 1-3
digits as well?
3) here's my shot
[[:alpha:]]{1,3}[[:digit:]]{1,3}(-[[:digit:]]{1,3})?

On Thu, Jun 12, 2008 at 12:59 PM, Noli Rafallo <[EMAIL PROTECTED]>
wrote:

_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to