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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:51:10+00:00 2026-06-11T05:51:10+00:00

Special sequences (character classes) in Python RegEx are escapes like \w or \d that

  • 0

Special sequences (character classes) in Python RegEx are escapes like \w or \d that matches a set of characters.

In my case, I need to be able to match all alpha-numerical characters except numbers.

That is, \w minus \d.

I need to use the special sequence \w because I’m dealing with non-ASCII characters and need to match symbols like “Æ” and “Ø”.

One would think I could use this expression: [\w^\d] but it doesn’t seem to match anything and I’m not sure why.

So in short, how can I mix (add/subtract) special sequences in Python Regular Expressions?


EDIT: I accidentally used [\W^\d] instead of [\w^\d]. The latter does indeed match something, including parentheses and commas which are not alpha-numerical characters as far as I’m concerned.

  • 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-11T05:51:12+00:00Added an answer on June 11, 2026 at 5:51 am

    You can use r"[^\W\d]", ie. invert the union of non-alphanumerics and numbers.

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

Sidebar

Related Questions

1) Escape sequences are mostly used for characters constants that either have a special
My password contains special characters like '&' and VS giving error on this like
I know that this is some kind of special character issue but I do
What special method(s?) should I redefine in my class so that it handled AttributeError
Is there any special function to parse a .conf file in php like parse_ini_file()
How to use special characteres like <,>,, and & in XML in Flex? Example:
How to embed special character in XML and have XDocument parse it? <?xml version=1.0
is there anything special I need to do to get ASP.NET MVC3 enabled on
I'm writing a special data structure that will be available in a .NET library
I have created a protocol in Clojure 1.2 that handles my own Java classes

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.