regex-negation Questions

4

Solved

How would I write a regular expression that matches the following criteria? No numbers No special characters No spaces in a string
Colossus asked 19/11, 2009 at 12:48

3

Solved

I need to match members of an array that end with "bar" but do not start with "foo", and put the result in a new array. Looking at the docs for 1.9.3 and 2.0.0, they seem to support negative look-...
Neurologist asked 11/4, 2014 at 5:53

3

Solved

I'm playing Regex Golf (http://regex.alf.nu/) and I'm doing the Abba hole. I have the following regex that matches the wrong side entirely (which is what I was trying to do): (([\w])([\w])\3\2) ...
Indigestive asked 25/12, 2013 at 15:47

7

Solved

I want an expression that will fail when it encounters words such as "boon.ini" and "http". The goal would be to take this expression and be able to construct for any set of keywords.
Igloo asked 22/9, 2008 at 19:5

5

Which regular expression can I use to find all strings bar are not preceded by string foo? Having whitespace between the two is also illegal. So the regex should match the following strings foo i...
Penley asked 2/12, 2009 at 20:40

1

Solved

I would like to match ampersand (&) but not when it exists in following manner ' " > < & &# So in the following line & MY& NAME IS M&...
Platter asked 7/5, 2013 at 15:36

1

Solved

I'm trying match all words wrapped with { } but not the words with "_loop". I can't see where I'm going wrong with my reg expression. $content = '<h1>{prim_practice_name}</h1><p&g...
Austinaustina asked 25/3, 2013 at 23:50

2

Solved

I'm trying to write Regex that will match a string of characters EXCEPT strings with an underscore. I have this so far /[A-Za-z0-9]+/ but I don't know what to include in it to make it require no u...
Photon asked 4/3, 2013 at 16:10

2

Solved

I'm trying to write a sed script that will capture all "naked" URL's in a text file and replace them with <a href=[URL]>[URL]</a>. By "naked" I mean a URL that is not wrapped inside an ...
Gradeigh asked 15/2, 2013 at 1:24

1

Solved

Possible Duplicate: Regular expression to match string not containing a word? How can I invert a regular expression in JavaScript? Say I have the regex foo123. How do I match everyth...
Gerda asked 4/2, 2013 at 8:27

3

Solved

Just for curiosity. Is it possible to create a regular expression that will not match any string, including an empty string?
Apeldoorn asked 2/1, 2013 at 0:15

1

Using vim 7.2, for this text: foo foo token foo foo countertoken foo foo token foo target foo foo countertoken foo I want to match each string starting with 'token' and ending with 'target', t...
Combustible asked 14/12, 2012 at 2:10

4

Solved

I'm trying to find all instances of the keyword "public" in some Java code (with a Python script) that are not in comments or strings, a.k.a. not found following //, in between a /* and a */, and n...
Permeable asked 11/12, 2012 at 5:31

2

Solved

I can't seem to find a way to extract all comments like in following example. >>> import re >>> string = ''' ... <!-- one ... --> ... <!-- two -- -- --> ... <!-- ...
Terminable asked 4/10, 2012 at 21:16

1

Solved

I'm using grunt to concatenate and minimize my js files, I use the following config for the concat part: concat: { dist: { src: ['<banner:meta.banner>', 'js/*.js'], dest: 'js/script.js' ...
Benedikt asked 16/6, 2012 at 15:30

2

The Input Line goes like this (just a part of it): [[Text Text Text]][[text text text]]asdasdasdasda[[asdasdasdasd]] What I want is to list all matches wherein text enclosed in a pair of [[ and...
Farra asked 6/3, 2012 at 8:39

2

Solved

In Visual Studio 2010, how do you search for text that is not within a single line comment? E. G. how to find "bas" in: foo bar bas but not in foo bar // bas Note that it should find the lin...
Adelaideadelaja asked 26/1, 2012 at 17:13

3

Solved

I am trying to figure out how to find numbers that are not years (I'm defining a year as simply a number that is four digits wide.) For example, I want to pick up 1 12 123 But NOT 1234 in or...
Bots asked 17/1, 2012 at 18:14

3

Solved

Case: ehello goodbye hellot hello goodbye ehello goodbye hello hello goodbye I want to match line 1 (only has 'hello' once!) DO NOT want to match line 2 (contains 'hello' more than once) Tried...
Helical asked 6/1, 2012 at 21:39

4

Solved

For PMD I'd like to have a rule which warns me of those ugly variables which start with my. This means I have to accept all variables which do NOT start with my. So, I need a RegEx (re) which behav...
Willamina asked 22/1, 2010 at 9:44

4

Solved

I am facing a problem to match and replace certain words, not contained in http:// Present Regex: http://.*?\s+ This matches the pattern http://www.egg1.com http://www.egg2.com I need a re...
Air asked 28/7, 2011 at 13:31

3

Solved

I'm trying to write a regular expression to match anything that isn't "foo" and "bar". I found how to match anything but one word at Regular expression to match a line that doesn't contain a wo...
Trefoil asked 26/7, 2011 at 13:33

2

Solved

I have an app where users can specify regular expressions in a number of places. These are used while running the app to check if text (e.g. URLs and HTML) matches the regexes. Often the users want...
Heuristic asked 3/5, 2011 at 11:4

6

Solved

I need to match all the whole words containing a given a string. string s = "ABC.MYTESTING XYZ.YOUTESTED ANY.TESTING"; Regex r = new Regex("(?<TM>[!\..]*TEST.*)", ...); MatchCollection mc ...
Jovian asked 17/4, 2011 at 6:45

3

Solved

I have a regex ([-@.\/,':\w]*[\w])* and it matches all words within a text (including punctuated words like I.B.M), but I want to make it exclude underscores and I can't seem to figure out how to d...
Charlettecharley asked 30/3, 2011 at 23:52

© 2022 - 2024 — McMap. All rights reserved.