We have a string that we need to parse using regex, the string could be either:
- There was a problem at XXXX
- There was a problem at XXXX, previous failures were YYY
The XXX could be any character (e.g. ".")
How can we make regex that will match:
- XXXX
- ", previous failures were YYY" (remember could be optional)
Every regex that I tried captures on the first match everything (because greedy or too little because not greedy)
I know this is advance but maybe someone already did it.