I have created a regex pattern for ID#. How can I modify it to include dashes (-) so that it accepts numbers with dashes as well?

Hi Kalam,
Hope you are doing well and safe.

Dear Core Team,

I have created a regex pattern for ID#. How can I modify it to include dashes (-) so that it accepts numbers with dashes as well?
regex(., ‘[1]{1,20}$’)

Thanks


  1. 0-9 ↩︎

Dear Core Team,

I have created a regex pattern for ID#. How can I modify it to include dashes (-) so that it accepts numbers with dashes as well?
regex(., ‘[1]{1,20}$’)

Thanks


  1. 0-9 ↩︎

Welcome to the community, @Rahimy! This support article Restricting Text Responses With Regular Expressions should help you answer your query.