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

83
Views
Regex validation numer and alphabet

So i wanna validating an student name input, that input can:

  • contain alphabets and number, but cant only number
  • and not case senstiive

Example :

  • Wawan Cakra 20
  • 14 James Smith
  • For You Page

code here :

name: Yup.string()
  .min(4, "Minimum 4 characters!")
  .max(30, "Maximum 30 characters!")
  .matches(/\b[A-Z][a-z]* [A-Z][a-z]*?\b/, "Only alphabets and numbers are allowed for this field!")
  .required("Name is required!")
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I would use the following regex pattern here in case insensitive mode:

^(?=.*[a-z])[a-z0-9 ]{4,30}$

This matches any input which contains at least one character, optional numbers and spaces, and has a length of between 4 and 30 characters.

var inputs = ["Valid", "21 Jump Street", "1234", "abc", "abcdeghijkabcdeghijkabcdeghijka"];
inputs.forEach(x => console.log(x + " => " + /^(?=.*[a-z])[a-z0-9 ]{4,30}$/i.test(x)));

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!