The challenge calls to capture all characters including the second "."
EG in string: FILE_NAME.EXTENSION.OTHEREXTENSIONadasd^^assdassds34
captured characters should be ".OTHEREXTENSIONadasd^^assdassds34"
Therefore I should end up with: "FILE_NAME.EXTENSION"
The regex I have tried either captures all characters after the first "." or throws up error: invalid pattern in look-behind
First example which brings up error:
string = "FILE_NAME.EXTENSION.OTHEREXTENSIONadasd^^assdassds34"
string.gsub(/(?<=[.]\S+)[.]\S+/, '')
Second example which incorrectly captures '.EXTENSION.OTHEREXTENSIONadasd^^assdassds34':
string = "FILE_NAME.EXTENSION.OTHEREXTENSIONadasd^^assdassds34"
string.gsub(/(?<=[.])\S*?[.]\S*/, '')
