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.
Related Posts:
- Regex not operator
- Regex not operator
- Regex how to match an optional character
- What is lexicographical order?
- working of \n in python [duplicate]
- Extract a substring using PowerShell
- How can I exclude one word with grep?
- Extract substring in Bash
- What is the difference between \r\n, \r, and \n? [duplicate]
- string to string array conversion in java
- What is the difference between \r\n, \r, and \n? [duplicate]
- How to remove punctuation in python?
- How to find all occurrences of a substring?
- How do I properly compare strings in C?
- How to remove .html from URL?
- Split string on whitespace in Python
- What is the difference between a “line feed” and a “carriage return”?
- How to convert an int to string in C?
- Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects
- Ignoring upper case and lower case in Java
- how to replace quotation marks with \”
- Remove all special characters, punctuation and spaces from string
- This can be done without regex:
- How to replace all double quotes to single quotes using jquery?
- Convert character to ASCII numeric value in java
- How to replace ” \ ” with ” \\ ” in java
- Regex how to match an optional character
- What does strcmp() exactly return in C?
- Generate random string/characters in JavaScript
- “[ ]” vs. “[[ ]]” in Bash shell
- What does regular expression \\s*,\\s* do?
- How to trim whitespace from a Bash variable?
- How can I remove punctuation from input text in Java?
- How to get the filename without the extension from a path in Python?
- sprintf like functionality in Python
- C – The %x format specifier
- Lua string.format options
- n-grams in python, four, five, six grams?
- Remove all special characters, punctuation and spaces from string
- Alphabet range in Python
- How can I remove punctuation from input text in Java?
- How can I match a string with a regex in Bash?
- How to trim whitespace from a Bash variable?
- What is the difference between ‘ and ” in JavaScript?
- Center text in fixed-width field with stream manipulators in C++
- C# – Illegal characters in path
- \n or \n in php echo not print [duplicate]
- Mips how to store user input string
- PadLeft function in T-SQL
- bash : Bad Substitution
- How to assign multiple lines string in Powershell Console
- LC-3 STR with R1 as offset
- Lua read beginning of a string
- How can I extract a number from a string in JavaScript?
- Regular Expressions on Punctuation
- How to extract a substring using regex
- How do I print my Java object without getting “SomeType@2f92e0f4”?
- How can I process each letter of text using Javascript?
- PHP to write Tab Characters inside a file?
- Regular expression – starting and ending with a character string
- Haskell: Converting Int to String
- How to use regex in String.contains() method in Java
- Passing string to a function in C – with or without pointers?
- Lua String replace
- Trim a string in C [duplicate]
- How to remove first character from C-string?
- Standard function to replace character or substring in a char array?
- How to count string occurrence in string?
- Difference between char* and char** (in C)
- Using strip() to clean up a string
- Extract filename and extension in Bash
- Meaning of #{ } in Ruby?
- Regex empty string or email
- Taking a new line using printf in java? Is %n correct?
- How to count instances of character in SQL Column
- String concatenation: concat() vs “+” operator
- How to remove the last character from a string?
- Regex: ignore case sensitivity
- Creating multiline strings in JavaScript
- How to validate an email address in PHP
- How can I prevent java.lang.NumberFormatException: For input string: “N/A”?
- Convert hex to binary
- Press Enter to Continue
- Split a string using string.gmatch() in Lua
- How do I apply the for-each loop to every character in a String?
- Parsing a comma-delimited std::string
- How to remove text from a string?
- Regex: Remove lines containing “help”, etc
- How to sort an array of objects in Java?
- C++ Simple hangman game
- How to ignore whitespace in a regular expression subject string?
- Add String Array to ArrayList
- StringIndexOutOfBoundsException String index out of range: 0
- Check if URL has certain string with PHP
- realloc(): invalid next size when reallocating to make space for strcat on char *
- Nested Shortcode Detection
- WordPress returns 404 on custom rewrite rule conflict in parameters
- get attributes/part of the gallery shortcode
- What is the structure of the “Featured Image” field in the DB?
- How to set up redirects for category paginated pages after adding /category/ to permalink