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

how to extract a number from a string if I know when its starting and when its finishing

for example: I have the following string "somestringthatcanbeanything theStringBeforeTheNumber20.47theStringAfterTheNumber somestringthatcanbeanything" so the number is always between theStringBeforeTheNumber{number}theStringAfterTheNumber What…
jack miao
  • 1,398
  • 1
  • 16
  • 32
0
votes
3 answers

JavaScript regex not replacing '@' character

I am new to JavaScipt and testing a regular Expression and is working on below use case - Requirement - Replace every character with '#' that is NOT FROM BELOW LIST- Number Character (upper or lower case) Any special character except -> comma,…
0
votes
3 answers

Parsing Text with Conditional Regular Expressions in VBA

I'm parsing large amounts of textual data using Regular Expressions in VBA within cells of an Excel document using Microsoft VBScript Regular Expressions 5.5. I can't figure out how to create a Regular Expression phrase that WILL match something…
Alex
  • 185
  • 1
  • 1
  • 14
0
votes
1 answer

Regex match a word not followed by two other words

I have some links: utmcsr=rdstation|utmccn=curso-intro-coaching|utmcmd=inbound|utmctr=link3 utmcsr=rdstation|utmccn=agenda-psc|utmcmd=email utmcsr=rdstation|utmccn=pnl-porto-alegre I want to build a regex expression that matches the rdstation not…
0
votes
1 answer

Bootstrap Validation: How Do I Write A Negated REGEX for data-pattern?

I'm using 1000hz Bootstrap Validator to validate fields within my contact form. I'm using data-pattern on an email field to make sure the format is correct. "data-pattern" => "myemailregexpattern" I want to write a data-pattern validation where I…
0
votes
2 answers

Regex Patterns in Java

I am using Regex Patterns and I need to check that the beginning of the String is an HTML Simple Text and return that String. So for example: Hello World! &nsbp; Should return: Hello World!
Free Lancer
  • 1,000
  • 2
  • 16
  • 33
0
votes
4 answers

Regex for string neither preceded nor followed by any alphabet character

I have these keywords: top top-blue blue-top my top light-grn-top top-cotton laptop laptop-glossy green top 0192 desktop 45WAI topbest (updated condition) 12. village_top1993 Required matches are : top, top-blue, blue-top, my top, light-grn-top,…
Subhajit
  • 876
  • 3
  • 17
  • 37
0
votes
2 answers

awk range regex not beginning

I have some data like this Data Table ABC Data Stop Data Data Stop Data Foo Data Foo I am trying to setup an awk range for Table ABC until Stop in the same column. I have…
NinjaGaiden
  • 3,046
  • 6
  • 28
  • 49
0
votes
1 answer

Regex to match pattern only if a string is not present in pattern

Stuck with finding a regex for a typical scenario. Not sure how this can be achieved in regex. Regex ---> (?is)[^:]\/\/ Payload ---> Regexp,test//check//last:// Matches ---> t// and k// Issue : I need to modify the above regex to ignore match for…
0
votes
1 answer

Regex: match only routes with or w/o GET params EXCEPT containing the 24 bytes HEX string

I wanna create 2 separate handlers for 2 routes below, first will do collections' actions, second - document related things. Two regex are needed for that. That pattern ^\/api\/([\w]+)\/([\w]+)(\/([a-f0-9]{24}))?\/?\??.*$ covers all two…
Xitroff
  • 101
  • 10
0
votes
1 answer

XML Schema (XSD) 1.0 xs:pattern regex to match 4 digits as a string?

How can I match a specific sequence of digits as if it were a string in an XML Schema xs:pattern? Say I have some tags containing arbitrary 10-character strings like 12345678990 And I want to rule out all tags with a specific…
Michael
  • 285
  • 5
  • 14
0
votes
1 answer

Regex to not match inside html anchor tag

I have a requirement where I don't have to match a specific word when in occurs between anchor tag. Anchor tags can have other html tags nested. For Example:
Ajinkya
  • 104
  • 11
0
votes
1 answer

Regex to match only strings that don't contain specific character

Looking to write some regex to match only the strings in the follow that don't contain a pipe. 4 Canciones: No. 2, Dices que no la quieres 5 Canciones canciones para niños: No. 1, Balada Spanish; Castilian | es Spanish; Castilian | es El…
Jake Handy
  • 11
  • 1
  • 3
0
votes
2 answers

.net Regex.Replace not excluding the caret character

I'm trying to use .NET Regex.Replace (example here in VB.NET) to exclude all non-chars and spaces from a string. For instance, in the string s below, I thought the pattern [^A-z ] should remove all non-alphabets aside from spaces. However, that…
0
votes
1 answer

How to achive result with regex replacement

Hello there I need regex expression which can do following transformation alabala-1000 Intern -> alabala/alabala-1000/Intern part before minus sign should be extracted and then space between alabala-1000 and Intern should be detected aswell
dian mushkov
  • 61
  • 1
  • 13