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 4053970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:30:53+00:00 2026-05-20T14:30:53+00:00

I am using a javascript validator which will let me build custom validation based

  • 0

I am using a javascript validator which will let me build custom validation based on regexp

From their website: regexp=^[A-Za-z]{1,20}$ allow up to 20 alphabetic characters.

This will return an error if the entered data in the input field is outside this scope.

What I need is the string that will trigger an error for the inputfield if the value has an asterix as the first character.

I can make it trigger the opposite (an error if the first character is NOT an asterix) with:

regexp=[\u002A]

Heeeeelp please 😀

  • 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-20T14:30:54+00:00Added an answer on May 20, 2026 at 2:30 pm

    How about:

    ^[^\*]
    

    Which matches any input that does not start with an asterisk; judging from the example regex, any input which does not match the regex will be cause a validation error, so with the double negative you should get the behaviour you want 🙂

    Explanation of my regex:

    • The first ^ means “at the start of the string”
    • The [ … ] construct is a character class, which matches a single character among the ones enclosed within the brackets
    • The ^ in the beginning of the character class means “negate the character class”, i.e. match any character that’s not one of the ones listed
    • The \* means a literal *; * has a special meaning in regular expressions, so I’ve escaped it with a backslash. As Rob has pointed out in the comments, it’s not strictly necessary to escape (most) special characters within a character class
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wanting to build a validator (javascript) that can validate numbers from different
I have a Spanish validation message which I'm trying to display using my JavaScript.
Does anyone know how to disable an ASP.NET validator using JavaScript? I'm using javascript
After trying to avoid JavaScript for years, Iv started using Query for validation in
I want to write a custom validator which doesn't do anything before the user
Hi i have a field in php that will be validated in javascript using
Further to my question on disabling validators using javascript - Disable ASP.NET validators with
Without using Javascript, is there a way to make a CSS property toggle on
I'm using JavaScript to hide an image and show some text thats hidden under
I need to edit (using javascript) an SVG document embedded in an html page.

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.