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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:27:19+00:00 2026-05-25T10:27:19+00:00

Is there an NOT operator in Regexes? Like in that string : (2001) (asdf)

  • 0

Is there an NOT operator in Regexes?
Like in that string : "(2001) (asdf) (dasd1123_asd 21.01.2011 zqge)(dzqge) name (20019)"

I want to delete all \([0-9a-zA-z _\.\-:]*\) but not the one where it is a year: (2001).

So what the regex should return must be: (2001) name.

NOTE: something like \((?![\d]){4}[0-9a-zA-z _\.\-:]*\) does not work for me (the (20019) somehow also matches…)

  • 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-25T10:27:19+00:00Added an answer on May 25, 2026 at 10:27 am

    No, there’s no direct not operator. At least not the way you hope for.

    You can use a zero-width negative lookahead, however:

    \((?!2001)[0-9a-zA-z _\.\-:]*\)
    

    The (?!...) part means “only match if the text following (hence: lookahead) this doesn’t (hence: negative) match this. But it doesn’t actually consume the characters it matches (hence: zero-width).

    There are actually 4 combinations of lookarounds with 2 axes:

    • lookbehind / lookahead : specifies if the characters before or after the point are considered
    • positive / negative : specifies if the characters must match or must not match.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there really not a TSpinEdit control for floats in Delphi? It looks like
I have read that viewstate is not there in asp.net MVC application. I am
Is there a way to implement operator->, not only operator*. To have following code
Why there is default move constructor or assignment operator not created for derived classes?
I am aware that the Lucene documentation says Note: The NOT operator cannot be
Is there any sort of not in operator in JavaScript to check if a
I have a formula in JS that uses the bitwise NOT operator. ~~(n/m +
Is there a way to do a not operator for a PCRE in the
There are two not equals operator - != and <> . What's the difference
In atlsafe.h there is some strange operator syntax I am not familiar with: operator

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.