Ok, in that case I'd suggest:
/filename="([^"]+)"/g.exec("form-data; name=\"file\"; filename=\"file.txt\"")[1]
Which matches filename="..." and returns what's inside the quotes
filename="..."
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, in that case I'd suggest:
/filename="([^"]+)"/g.exec("form-data; name=\"file\"; filename=\"file.txt\"")[1]
Which matches
filename="..."
and returns what's inside the quotes