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

Exclude Character in Google Analytics via Regex

I'm trying to exclude (in a Goal) a character in a regex in Google Analytics. Basically, I have two pages with the following URL: /signup/done/b /signup/done/bp Note that both might have UTM parameters after in some results as well I am trying to…
avi
  • 180
  • 7
0
votes
2 answers

Regex excluding words in certain sequence

I would like to filter out certain fields, if they do not match criteria. The problem is their sequence. I tried following constructions: (EXCLUDING)(?!\(MONDAY)(.*MONDAY).* and (EXCLUDING)(?!\()(.*MONDAY).* What I want to achieve is to find a…
Slav
  • 469
  • 4
  • 18
0
votes
1 answer

Get text between two ""

I am struggling with the following text: c(\Study:\", \"Job:\", \"Branch:\", \"Position:\", \"Naming:\", NA, NA, \"Banker\", \"VP of Sales\", \"\", NA, NA, NA, NA, NA)" I would like to get from a regex, the VP of Sales. Instead of the VP of Sales…
Carol.Kar
  • 4,581
  • 36
  • 131
  • 264
0
votes
1 answer

Regex Pattern Format Validation

I need a RegEx pattern which will be sent by the client where the starting characters will be alphanumeric, the length of this starting String will be defined by the number after this String. This is followed by a special character which will always…
Tiny
  • 683
  • 5
  • 18
  • 36
0
votes
2 answers

regex: How to match these words except those words?

I want to match some words in regex except some others: ex: all words that contains straat, laan, baan (straat|laan|baan) But not (overslaan|bestraat|rubaan) ex: mystraat bolaan overslaan boobaan rubaan should match mystraat bolaan boobaan
yarek
  • 11,278
  • 30
  • 120
  • 219
0
votes
1 answer

Capture exclamation mark before " and ( but not inside "" (RegEx)

How do you capture an exclamation mark ! before " and (, but not inside two double quotes "? Before prerequisity is ok, but latter part, that exclamation mark should not be inside doubles quotes, should be added: \s*([\!])\s*(")|\s*([\!])\s*(\()…
MarkokraM
  • 980
  • 1
  • 12
  • 26
0
votes
1 answer

Regex matching MC questions in extracted PDFs

Wanted to ask about how I could extract questions in this format: In an ACCUPLACER® placement test, there are 20 Sentence Skills questions of two types. The first type consists of sentence-correction questions that require an understanding of…
Dranithix
  • 378
  • 3
  • 12
0
votes
2 answers

Regex evaluate string and inner strings in quotes for balance and length

I want some regular expression to evaluate an entire string to ensure all inner strings are surrounded in quotes and are under a certain length (under 5 characters). For Example (whole string in bold including spaces): "hi" I want a match "goodbye"…
garyamorris
  • 2,587
  • 2
  • 17
  • 23
0
votes
1 answer

Select all text but HTML Tags

Been trying to figure this out for a while, came across this (<[^>]*>) which helped me select all html tags, my objective is to use regex to help me select anything but HTML tags.. i tried to negate this but couldnt figure it out.. Apprecaite your…
Raeef
  • 13
  • 4
0
votes
1 answer

Regex to ignore string in URL

Trying to write regex for reddits subreddits. My regex will replace the subreddit name with a link, but I would like for it to ignore a link within a url that's already being displayed. For example let's say I have the following 3…
bertmaclin
  • 304
  • 3
  • 16
0
votes
0 answers

How to remove query string variable from url using htaccess

my website has dynamic pages such as http://www.example.com/index.php?layout=category&category_name=shoes&subcategory_name=sport I want to remove or hide query string variable from url and display as http://www.example.com/shoes/sport Can't write…
Seda
  • 1
  • 1
0
votes
1 answer

Negating a regex query

I have looked at multiple posts about this, and am still having issues. I am attempting to write a regex query that finds the names of S3 buckets that do not follow the naming scheme we want. The scheme we want is as…
Lawrence Aiello
  • 4,560
  • 5
  • 21
  • 35
0
votes
0 answers

Regex that matches strings that don't start or end with something

I am trying to write a swift lint rule that will ignore certain files in my project. Those files either start with Fake or end with Spec.swift. Example: Object.swift FakeObject.swift ObjectSpec.swift I only want the regex to match on…
Randall
  • 14,691
  • 7
  • 40
  • 60
0
votes
1 answer

Replacing html tags using regex and add_filter()

I want to replace the

tag with

tag. I've tested the regex on regex101.com and the capturing groups are there. Is this proper way to do so? Maybe Wordpress is not triggering my add_filter()? function…

InsuredApple
  • 63
  • 1
  • 3
  • 12
0
votes
1 answer

how to match a variable lines string such as in log with a specific criteria?

Example: I want to match the error block with lines that begin with processing and end with error saving data. The issue I run into is either with greedy or lazy match, regex matches previous values too! Processing employee 123 1504 of 2056…
Ram
  • 3
  • 1