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

Read values in numeric xml tags using Regex

I need to read the values of numeric xml tags. e.g. <101>ThisIsOneValue I want one REGex that gives me "ThisIsOneValue"
0
votes
1 answer

How to capture two separate group patterns with Regex?

I have this pattern in over 10.000 places: 11,1,2,0,0,"Lorem ipsum dolor sit amet, 8 - 14. consectetur adipiscing elit. 6 - 13. Aenean semper fermentum ipsum sed vehicula. In commodo sit amet libero et rhoncus. Cras vitae dapibus nisl. Mauris…
neowinston
  • 7,584
  • 10
  • 52
  • 83
0
votes
1 answer

Regex to match exact word without spaces

I have a query such as the below: SELECT * from table_name where lastname regexp "[[:<:]]Smith[[:>:]]" This returns De Smith Smith I only need to retrieve Smith I even tried the below SELECT * from surnames where last_name regexp…
Stackoverflow User
  • 161
  • 1
  • 4
  • 10
0
votes
2 answers

SQLite regular Expressions regex get exact word by number

I have a string like the following in a sqlite 1 column: 1a 2B 3c 354 AfS 151 31s2fef 1fs31 3F1e2s 84f64e 45fs space separated, x amount of characters 0-9, a-z, A-Z, there might be punctuation I'm not sure, but it is definitely space…
MetaStack
  • 3,266
  • 4
  • 30
  • 67
0
votes
1 answer

Regex: How to get something between text, except something between other text

Ok, this is kind of trick. I have this text:

quoiwuqoiuwoi aoiuoisquiooi Some text here in the middle! =)

I want to…
user3347814
  • 1,138
  • 9
  • 28
  • 50
0
votes
1 answer

Regex group findings of two matches

I'm not big fan of regex but this time I think that there is no way to do what i want. Please see my example with real live testing: (BEGIN @\d+\b.*?ACTION_READLN ~.+?~) Consider such raw text data: BEGIN @1011 Text Text ACTION_READLN…
ALIENQuake
  • 520
  • 3
  • 12
  • 28
0
votes
1 answer

Regex Negation on part of word

I'm doing a regex search through about 20,000 HTML files using SublimeText and trying to find out of certain CSS classes exist or not. Unfortunately, some classes are similarly named and I want to ignore those ones. For example, I'm looking for…
Kevin
  • 79
  • 7
0
votes
1 answer

Tag all words between a negative word (like don't or never) and a punctuation as Negative words

I am trying to to build a regex match-replace routine which will take all words which occur between a negative word and a punctuation and add a _NEG suffix to them. For example: Text: I don't want to go there: it might be dangerous. Output: I…
0
votes
3 answers

php find # in string with regex

I have a php variable where I need to show #value Values as link pattern. The code looks like this. $reg_exUrl = "/\#::(.*?)/"; // The Text you want to filter for urls $text = "This is a #simple text from which we have to perform #regex …
Mitul Maheshwari
  • 2,647
  • 4
  • 24
  • 38
0
votes
4 answers

A regular expression to exclude a specific string '[[' via sed

I need to fetch string which between '[[' and ']]' using sed in file: response.txt x-content-type-options: nosniff x-server-response-time: 63 x-dropbox-request-id: 84e52618f83eda15cb6d96eb4f601f45 pragma: no-cache cache-control:…
Joe Angel
  • 19
  • 8
0
votes
4 answers

Java Regex : How to ignore a set of words

I have this (.*)([USB][\s])* as a part of a regex. When i'm trying to match it with ABHISHEK USB it matches but full value matches with the first part. Is there any way by which i can ignore USB part from (.*) and have it matched to ([USB][\s]).
Abhishek Agarwal
  • 846
  • 4
  • 13
  • 34
0
votes
2 answers

Regex that removes everything except specified string

I am working with data that looks something like…
owwoow14
  • 1,694
  • 8
  • 28
  • 43
0
votes
1 answer

Discover identically adjacent strings with regex and python

Consider this text: ... bedeubedeu France The Provençal name for tripe bee balmbee balm Bergamot beechmastbeechmast Beech nut beech nutbeech nut A small nut from the beech tree, genus Fagus and Nothofagus, similar in flavour to a hazelnut but not…
pebox11
  • 3,377
  • 5
  • 32
  • 57
0
votes
1 answer

Regex for non empty string and 3 letter alphabetical

I am trying to write Regex for a 3 letter alphabetical string which is not empty. I have tried the following (?=(^$)|(\s+$))(?=[A-Z]{3}) I know that ?= acts as and operator,(^$)|(\s+$) check for non empty and white space, but the following regex…
phani sekhar
  • 107
  • 1
  • 1
  • 13
0
votes
1 answer

Regular Expression that does not match a given sequence

I need a regular expression that matches this text description: "any sequence that is not an F (upper case only) followed by a run of 1 or more digits (0-9)". This needs to go as input to Java's Scanner.useDelimiter(). Suppose the input line is…
FreeBird
  • 691
  • 1
  • 8
  • 18