Link Regex101 I am using (FD.*?)FD however I am missing every second expression - see regex. Any ideas?
Asked
Active
Viewed 81 times
-2
-
See [here](https://stackoverflow.com/a/40782646/3832970), scroll to *Scenario 3*. – Wiktor Stribiżew Jan 15 '20 at 21:01
1 Answers
0
The trailing "FD" in your regex matches the "FD" in the input that starts the next "item" in the input text, so the entire next "item" is skipped, until it finds another "FD".
In a case like this, instead of specify .*
followed by the pattern that starts the next item, you typically want to specify anything not including a pattern of FD
.

Jerry Coffin
- 476,176
- 80
- 629
- 1,111