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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:06:20+00:00 2026-06-08T23:06:20+00:00

Was playing around with regexp to remove all numbers from string I came up

  • 0

Was playing around with regexp to remove all numbers from string

I came up to this:

   /([^0-9])$/

But it works only if string looks like this, e.g. Name123 but if you enter Name123Name than it doesn’t work?

Can’t understand why?

Any ideas?

Best regards,
Ilia

  • 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-06-08T23:06:21+00:00Added an answer on June 8, 2026 at 11:06 pm

    Your regular expression finds one character not in [0-9] at the end of the string.

    To check if there is a digit anywhere in the string, remove the anchors:

    /[0-9]/
    

    To check that all characters are not digits, add a start of string anchor too:

    /^[^0-9]+$/
    

    This approach is called a blacklist – a list of characters you don’t want to allow. Note that it’s often better to create a whitelist instead – a list characters that you do want to allow.

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

Sidebar

Related Questions

iam playing around with OPEN CV from Intel with the associated PHP Extensions. Works
I've been playing around with retrieving data from a string using regular expression, mostly
While playing around with regexps in Scala I wrote something like this: scala> val
I was playing around with Boost.Regex to parse strings for words and numbers. This
After playing around with haskell a bit I stumbled over this function: Prelude Data.Maclaurin>
Been playing around with this for a couple of hours and can't seem to
I have a string looking something like this string myString = Master Language=\C#\ MasterPageFile=\~/masterpages/Libraries.master\;
I'm playing around with websites and regular expressions in C#. I have this situation:
I've been playing around with HPricot, but after a fair amount of searching, I've
I'm playing around with Sinatra, and I would like to make one of my

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.