Here is the string I am working with:
var data = "Validation failed: Attachments document 01april2015_-_Copy.csv has contents that are not what they are reported to be, Attachments document 01april2015.csv has contents that are not what they are reported to be"
This is the regex pattern I am using:
var regex = /Validation failed:(?:(?:,)* Attachments document ([^,]*) has contents that are not what they are reported to be)+/;
The result of applying the regex on the data is as follows:
data.match(regex)
["Validation failed: Attachments document 01april2015_-_Copy.csv has contents that are not what they are reported to be, Attachments document 01april2015.csv has contents that are not what they are reported to be", "01april2015.csv"]
data.match(regex).length == 2
true
The expected result should include both filenames, but I am only getting one. The filename 01april2015_-_Copy.csv
is missing from the match. Can someone explain why this is happening?