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

126
Views
Regex must have letters only and one dot

I am trying to build a regex that must contain letters only and one dot.

There is a restriction: the dot cannot be placed in beginning or the end.

Example:

abc.difference

I tried to use

^[a-zA-z]*(\d*\.\d*)[a-zA-z]*$
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

f the dot can go missing in the input string, you can use

/^[A-Za-z]+(?:\.[A-Za-z]+)?$/

If the dot is obligatory:

/^[A-Za-z]+\.[A-Za-z]+$/

Details:

  • ^ - start of string
  • [A-Za-z]+ - one or more letter chars
  • (?:\.[A-Za-z]+)? - an optional occurrence of
    • \. - a dot
    • [A-Za-z]+ - one or more alpha chars
  • $ - end of string.
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!