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

212
Views
pattern validator accept everything without word characters

i am trying to create a pattern that accept everything without word characters (a-z or A-Z) in angular.

  phone: new FormControl(null, [
    Validators.required,
    Validators.pattern("^-?[0-9]\\d*(\\.\\d{1,2})?$"),
  ]),

i try this patter but not work fine because my goal is:

pattern must accept :

()*#%&#@64582 (example 1)
3796592#$#@$%^&$&/ (exapmle 2)
34242+5334?@^#$#%4242 (example 3)

That mean everything without (a-z or A-Z)

Pattern must not accept :

$%$@#423URVB 
t3653$^%#&#%&

Any idea ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your suggested pattern allows positive or negative floats and is not relevant to your wishes

Normally we use a negated class

/^[^a-zA-Z]$/g

but that will allow öää for example

/^[^a-zA-Z\p{L}]$/gu

will also block unicode characters but allow special characters

https://regex101.com/r/WxARn2/1

I can however not find how to add the flag to Angular PatternValidator so you will need to test it

about 4 years ago · Juan Pablo Isaza Report
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!