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

  • Home
  • SEARCH
  • 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 8611371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:21:33+00:00 2026-06-12T04:21:33+00:00

I need to check if a string contains anything except the digit. But I’ve

  • 0

I need to check if a string contains anything except the digit. But I’ve got a problem.

echo bdfbdfd | findstr /R [^0123456789]

returns nothing, but it should return bdfbdfd.
But

echo 123 | findstr /R [^0123456789]

returns ‘123’. Why? It should work vice versa.

  • 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-12T04:21:34+00:00Added an answer on June 12, 2026 at 4:21 am

    After a lot of tests here we go:

    echo 123 | findstr /R "[^0123456789]"
            ^ this space is what is matched, remove it and it won't match anything
    

    Another way to do this is (as Christian.K stated) escaping the ^ thus writing

    echo 123| findstr /R [^^0123456789]
    

    (note the ^^)

    For the bdfbdfd part putting the second regex between "" and removing the space makes it work for the specified string.

    EDIT:

    Note that you are matching a single character. In the match

    echo bdfbdfd | findstr /R [^0123456789]
    

    nothing was matched because your string didn’t contain any digit (not counting the ^ which needed to be escaped). In

    echo 123 | findstr /R [^0123456789]
    

    you were matching the first digit. With your regex you’ll match any string that contains a single match, so also trying to match 123(space) with the regex [^^0123456789] will output the whole string as a match because of the non-digit character in the end of the string.

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

Sidebar

Related Questions

Ive got this problem where I need to check an arrayposition if the string
I need to check whether a string contains any swear words. Following some advice
I need to check if a string contains a valid Oracle table name using
I need to check whether a string contains white spaces commas and more than
In Python, how to check if a string only contains certain characters? I need
Pretty straight forward. In javascript, I need to check if a string contains any
I need to check if my constant contains (string) of any items of my
I need to check that specific string contains in the set of others: private
I need to check to see if a string contains at least one number
I need the regex to check if a string only contains numbers, letters, hyphens

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.