0

https://regex101.com/r/0DT5zE/2

In the following example, I want to match line 1, 2 and 5.

-STARTxxx-END
-STARTxxx-
-STARTxxx#END
-STARTxxx#
-STARTxxx

Using regex: -START(?=(?:xxx[-$]))

In words: after the -START tag, there should be xxx, followed by either a dash - or the lineend $.

Question: why doesn't the last line produce a match? What am I missing when using the lineend $?

membersound
  • 81,582
  • 193
  • 585
  • 1,120

0 Answers0