regular expression

Hello

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

Thanks for your help
LVL 1
SkycaptAsked:
Who is Participating?
 
cubeeqConnect With a Mentor Commented:
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
 
cubeeqCommented:
Could you be more specific? You can find this exact expression when you just call it: P123/ABC.
0
 
SkycaptAuthor Commented:
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
 
SkycaptAuthor Commented:
Hi, thanks for your help, here's my final code

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

From novice to tech pro — start learning today.