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
0 answers

regex which matches a string without a specific word (anywhere)

I found many questions regarding this on SO, but they always assume that the word is at the beginning or end. Assuming the word is cat, I don't want to match any of these: cat hellocat catfood nocatthere A common idea seems to be something like…
lhk
  • 27,458
  • 30
  • 122
  • 201
0
votes
2 answers

In a Stored Proc, looking for table names (maybe with regex?) excluding two schemas

My company is moving all report generation tables to another server, and to do that we need to find all instances where stored procedures access live tables and remove those accesses and replace them with accesses to snapshots. There are quite a few…
Jeff.Clark
  • 599
  • 1
  • 5
  • 27
0
votes
1 answer

Don't initiate old-to-new-domain RewriteRule if a certain variable is specified in query string

I've searched SO and Google long and hard for this one and I'm really surprised not to have found an answer (or stumbled upon the solution by trial and error!). It's a slightly tough search as most of the keywords lead to people wanting to exclude…
Matt Morrison
  • 1,540
  • 1
  • 14
  • 19
0
votes
2 answers

How to exclude 0-9 in perl regex

In a comparison, I'm trying to exclude strings ending in a single numeric digit but can't get it to work. Given: @drives = ("sda", "sda1", "sda2", "sdb", "sdb1", "dm", "dm-0"); for $part (@drives) { if ($part =~ /sd.[^0-9]/) { print…
Danny
  • 2,482
  • 3
  • 34
  • 48
0
votes
1 answer

Find lines without repeated text

I have problem with my work to find different line. The example is number 4. How to get mark for number 4? Line Text 1. ABCDEFGHJK ABCDEFGHJK 2. JKJKJKJKJK JKJKJKJKJK 3. JLKIHWTWBE JLKIHWTWBE 4. wieufhwiwe …
0
votes
1 answer

Javascript regexp take strings between {{}} but excluse those wrapped in

I'd like to use a regexp to wrap all the strings between {{ }} but not those between {{ }}. I think I need to excluse {{ }} but when I try using this : text = text.replace(/(!\
user2094540
0
votes
1 answer

How do I check if a particular value in a series of values has already been added to XML prop?

Consider set data {red;blue;green} I can add a new color using incr count [regsub -all -- \ [appendArgs (< $name >)(.*?)()] $data [appendArgs \ \\1 $newValue \\3] data] where newValue is defined by set…
tofutim
  • 22,664
  • 20
  • 87
  • 148
0
votes
1 answer

Regex for email not validating numbers in the high level domain

private const string EmailPattern = @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z"; I am able to validate most of the emails correctly but one of the…
Scorpio
  • 1,151
  • 1
  • 19
  • 37
0
votes
1 answer

Social Engine 4 User profile rerouting

For Social Engine 4, which uses Zend framework. I want to show user profiles under subdomains. so, http://domain.com/profile/username will be http://username.domain.com How can I do this. I do already have one extension which makes…
0
votes
4 answers

Regex Expression to allow comma only inside a string (within quotes)and not outside it

I am kind of new to regex. I am looking for a regex expression to add it as a constraint not to allow comma outside a string . My input is like "1,212121,121212","Extra_data" Here the regex expression should not check for comma in the first value…
0
votes
0 answers

HowTo prevent matching an empty string ('') at the beginning of a string include match within the string

I am trying to match a name with the following regex /^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,\'\-]+$/ This matches the following examples: Tom Dooley D'Agaene-Venus Tom However,…
st_clair_clarke
  • 5,453
  • 13
  • 49
  • 75
0
votes
1 answer

regex match '<'

I need use javascript regex to match '<' as an operator, not html markup. Here is sample data: length(9)>8 [12]>[11] 99 Here is Regex101
Jackie
  • 127
  • 1
  • 6
0
votes
0 answers

Mongo Query Parser Regex

i want to extract query part(name,find,sort,limit - split by dot(.)) from mongo query via regex input - > db.metrics.find( { "brand_name":"Apple", "job_status.status":"SUCCESS", 'host.user':'root', …
0
votes
1 answer

Java Regex with one matching and two negations in any position

I have to match a keyword provided it is not in a sentence compounding an URL nor certain words. For instance, with the keyword .NET, the string must not have http://, and the characters after .NET must not be work or flix, but can be framework or…
0
votes
1 answer

Invert regex with sequenction

I have this regular expression /(\w)\1{3,}/ for found if string contains 3 or more same chars behind (like johhhhn). Is there any easy possibilities how this regex invert to not match?
XWizard
  • 319
  • 6
  • 17