Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6363767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:04:42+00:00 2026-05-25T00:04:42+00:00

I am working on a registration form, where i am providing validation(spring) for input

  • 0

I am working on a registration form, where i am providing validation(spring) for input (user)data.
I have fields like

Name (Full Name)

Only Characters are allowed

-> Acceptable values are :
A, AB, A B, A B C, Abc def, abc def ghi

-> No Junk/special characters are allowed.

  • Regular expression i am currently using :

    Pattern.compile("(([a-zA-z])+([\\s]+[\\s])?[^*$&!@%~\",:;{}|=()_0-9])*");
    

-> string with single and two spaces are working, which is fine.

-> only numbers not accepting, which is fine.

  • problems

-> pattern doesn’t work with “single character”, like “a” or “A”

-> not throwing an error on entering Alphanumeric, like abc23

Income

Which should accept strictly only numerical values

  • Regular expression i am currently using :

    Pattern.compile ("(([0-9])?[^*&!@%~\",:;{}|=()_a-zA-z])*")
    
  • problem

    accepting alphanumeric

Registration No

it can be a character, can be a number, can be aplhanumeric, but no space is allowed

Can anyone please help me in writing the correct regexp (only regexp works) for the above mentioned fields?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:04:42+00:00Added an answer on May 25, 2026 at 12:04 am

    Your regexps are long which leads me to think there may be additional constraints.
    However, given the bullet points you’ve given…

    For the name, you can use:

    Pattern.compile("[a-zA-Z ]+")
    

    For income, you can use:

    Pattern.compile("[0-9]+")
    

    For registration, you can use:

    Pattern.compile("[a-zA-Z0-9]+")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have working user registration form. It consist of Zend Form Elements. Now I
I have a working PHP registration form that goes through $_POST[] requests to check
In need splitted date fields for dob (like the facebook registration form) in my
I'm working on a jQuery-powered registration form, and I'm checking all the input with
I have a registration form on an app im working on. You enter your
I have the fullcalendar jQuery plugin working, but I'd like to show more data
I'm working on a simple mobile site that have a registration form for Interest,
I have coded custom form validation. validation is working fine all browser but when
I am working on an application which has a registration form and I have
I'm making a form for user registration. Here's what my template looks like: <h1>Register</h1>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.