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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:04:51+00:00 2026-05-28T11:04:51+00:00

In my current regular expression, I am negating digits: $(function(){ $(#somewhat).bind(keyup, function(event) { var

  • 0

In my current regular expression, I am negating digits:

$(function(){
  $("#somewhat").bind("keyup",
   function(event) {
     var regex = /^[\D]*$/;
     alert(regex.test($("#somewhat").val()));
  });
});

What I have in my mind is to add some special characters on which I should negate, !@#$%^&*()_+=<>.?/~`:;” , and leaving dash, apostrophe ( -‘ ) to the valid list. I’m still kind of dizzy on this regular expression thing. To test with, I added + on the regex,

var regex = /^[\D+]*$/;

When I test it, the alert box returns TRUE, which is not I am expecting.

  • 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-28T11:04:51+00:00Added an answer on May 28, 2026 at 11:04 am

    Inside [ ] please add all the characters you don’t want to allow.

    /^((?![\d!@#$%^&*()_+=<>.?/~`:;"]).)*$/
    

    But can we rely on negating given characters ? because user will be able to enter any character other than these. If you want to allow non-English characters, I would suggest you to use Unicode ranges

    see this : http://kourge.net/projects/regexp-unicode-block

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

current code I've built function to do something over collection of jQuery elements: var
I current have the following regular expression to accept any numeric value that is
I am trying to add wild characters to my current alphanumeric only regular expression
I would like to find a regular expression (regex) that does detect if you
I need to match the following values and my current Regular Expression can't seem
How do I modify my current regular expression /^[0-9+-]{6,20}$/ so it allows whitespaces and
I'm new to regular expression and have come across a problem. I want to
How can I make the following regular expression ignore all whitespaces? $foo = ereg_replace([^áéíóúÁÉÍÓÚñÑa-zA-Z],
I'm trying to extract/match data from a string using regular expression but I don't
I have a very basic regular expression that I just can't figure out why

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.