Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

regular expression

Hello

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

Thanks for your help
0
Skycapt
Asked:
Skycapt
  • 2
  • 2
1 Solution
 
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
 
cubeeqCommented:
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
 
SkycaptAuthor Commented:
Hi, thanks for your help, here's my final code

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now