Questions tagged [regex-negation]

Regex-negation is an operation performed on a character class that complements its pattern. The result is the character class matching anything not in its class.

Regular Expression negation is typically used to search for patterns that are not desired.

The regular expression language provides some features to handle this, notably negative lookahead/lookbehind, see this tutorial for details.

1926 questions
0
votes
1 answer

replace characters in notepad++ BUT exclude characters inside single quotation marks(3rd)

replace characters in notepad++ BUT exclude characters inside single quotation marks replace characters in notepad++ BUT exclude characters inside single quotation marks(2nd) Sorry, sorry to all users (especially to Avinash Raj + Jonny 5) who…
ora_job
  • 103
  • 7
0
votes
1 answer

Count everything that isn't in tags with Regex

I'm trying to count everything that isn't in tags, but failing. The sentence: Hi User should return the count of Hi User (7) I tried with (!?<[^>])^.{1,140}$ but since I'm pretty new to Regex I can't seem to get it right!
user2687506
  • 789
  • 6
  • 21
0
votes
1 answer

Why those two expressions are not equal?

I want to capture words that don't have the same letters next to each other. This one finds a letter and then checks if another letter next to it is not the same. This one works. \b((\w)(?!(\2)))+\b This one says do not match words that have the…
John Smith
  • 87
  • 10
0
votes
1 answer

How to negate the word using regex in url path in html ?

Hello I want to capture the url path without the language code. For example, abc abc abc abc
Long Ranger
  • 5,888
  • 8
  • 43
  • 72
0
votes
2 answers

How to match files end not with regex

I am trying to filter all files not ending with, for instance mp3 or wv. I have tried to use something like this ^.*(?
0
votes
1 answer

How do I write a regex to match a string that doesn't contain a word?

Possible Duplicate: Regular expression to match string not containing a word? To not match a set of characters I would use e.g. [^\"\\r\\n]* Now I want to not match a fixed character set, e.g. "|=" In other words, I want to match: ( not ", not…
Peet Brits
  • 2,911
  • 1
  • 31
  • 47
0
votes
1 answer

python regex lookahead and negative lookahead

I am trying to extract messages on my git commit message. With the code below: import sys, os, re alpsym = '[A-Za-z_-]' num = '[0-9]' ticket = '(?:ticket|issue|bug[: ]?)' actions = '(?:re|close|closes|closed|fix|fixes|fixed?)' msg = "testing re #119…
Efox
  • 651
  • 3
  • 8
  • 19
0
votes
3 answers

Ignore first character of string - JS - Regex

I'm trying to write a Regex that will ignore the first character of a string and start with the second character. e.g. str = "14"; test = "4"; This will match ONLY if 4 is is position 2 (end of the string) and NOT at the start, the following will…
woolm110
  • 1,194
  • 17
  • 27
0
votes
1 answer

Regex matching 2 similar phrases

I am trying to match to automatically grade a student's answer to a question where the correct answer is: read and execute for owner and read for everyone The order of their answer doesn't matter so read for everyone and read and execute for…
jhnewkirk
  • 87
  • 9
0
votes
2 answers

centreon_plugins ignore with regexp

how can I ignore or filter parts of the result of centreon_plugins.pl using a regexp ? practical example : I'm trying to monitor inodes on all my linux servers (RHEL 6) so I use the following command: perl centreon_plugins.pl…
0
votes
1 answer

Node-Minimatch/Regex: Match subdirectories within a specified subdirectory

I would like to match all subfolders within a given subfolder. Let's say I have the following…
Steven
  • 1,052
  • 17
  • 30
0
votes
4 answers

sed don't match characters inside parenthesis

I'm trying to come up with a SED greedy expression which ignores the stuff inside html quotes and ONLY matches the text of that element.

100

#need to match only second 100 100 #need to match only second…
zzart
  • 11,207
  • 5
  • 52
  • 47
0
votes
3 answers

Regular expression. Begins with and not equal to

I have a string that needs to be validated. The first two characters must be made up A-G, or Z, but cannot be the following combination: GB or ZZ. How do I express that in a regular expression?
iBiryukov
  • 1,730
  • 4
  • 19
  • 30
0
votes
2 answers

Regular expression which excludes all kinds of URL

I could find various examples of regular expression regarding http / protocols and urls but still I could not find the exact regular expression which can avoid all kinds of url or protocols. My aim is to not allow any kind of url in a text box (…
gSingh
  • 57
  • 1
  • 14
0
votes
1 answer

How to match methods without a specific category

I need to remove some tests from several classes without some specific category how do I match than? in this example i want to remove only the methods 'Bar' and 'BarTwo' namespace MyNameSpace { /// /// Some Stuff ///…
Raoni Zacaron
  • 367
  • 5
  • 15
1 2 3
99
100