You are viewing limited content. For full access, please sign in.

Question

Question

Regex to match patter and begin with a specific string

asked on August 21, 2020

I am looking for regex that will match this pattern and MUST begin with 06:

06-00-00-00-00-000-0000

I tried this and slight variations thereof, but get "invalid input" each time I try to paste in the above string:

^[06]-\d{2}-\d{2}-\d{2}-\d{2}-\d{3}-\d{4}$

Thank you.

0 0

Answer

SELECTED ANSWER
replied on August 21, 2020

Try this: ^06-\d{2}-\d{2}-\d{2}-\d{2}-\d{3}-\d{4}$

1 0

Replies

replied on August 21, 2020

Bingo - thank you!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.