Solved

regular expression

Posted on 2009-04-05
4
269 Views
Last Modified: 2012-05-06
Hello

I need to search for P123/ABC using a regular expression?

Thanks for your help
0
Comment
Question by:Skycapt
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:cubeeq
ID: 24073588
Could you be more specific? You can find this exact expression when you just call it: P123/ABC.
0
 
LVL 1

Author Comment

by:Skycapt
ID: 24075433
Oh sorry,

I have a list of products P123 to P500 in number order but 5 or 6 of them have the extended code P123/ABC the numbers and letters may vary so you may get P234/DEF they also may change from day to day so I cant just isolate individual codes.

Hope that helps
0
 
LVL 3

Accepted Solution

by:
cubeeq earned 250 total points
ID: 24075699
ok, the most general variant is "P[0-9][0-9][0-9](/[A-Z][A-Z][A-Z])?" - it also matches P000/AAA, you can narrow it to "P[1-5][0-9][0-9](/[A-Z][A-Z][A-Z])?" and so on. if you want the most specific thing, i will post something more complex.
0
 
LVL 1

Author Closing Comment

by:Skycapt
ID: 31566842
Hi, thanks for your help, here's my final code

'^[P][0-9]{3}(/[A-Z]{3})?$'
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now