Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Error with regex number input form field in Angular material

I am using Validators.pattern(/^[1-9][0-9]{0,2}$/) to allow only numbers from 1 to 999 on the number input field.

This regular expression is validating correctly even for -ve values if selected from input range arrows(have set min=1, max=999 on <input>). But when I type number explicitly its accepting 099, 0999, 0990 too and not displaying error. The same pattern when checked in regex101.com says "no match" for inputs starting with 0. Why is the same regex pattern working weirdly in actual code(matching) and regex101.com(not matching)?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!