1

I am trying to find all strings not ending with the sequence -6X. What i'm trying to do is compare the value of an xml tag with a sequence. If it matches then do some stuff. However I am unable to do so. I want to achieve this without any lookaheads or lookbehinds.

I've tried using .*[^-6X] However this does not work for strings ending in - or -5 . I want to ignore strings ending in -6X only and every other pattern should work. Thanks in advance for your help

Arun Gowda
  • 2,721
  • 5
  • 29
  • 50
Sr7
  • 86
  • 1
  • 9

1 Answers1

0

This matches Strings NOT ending with -6X:

.*?([^-]..|.[^6].|..[^X])$

https://regex101.com/r/omwkQ3/2

D. Braun
  • 508
  • 1
  • 4
  • 11