-
• #2
Looks like there's a bug in how the index of the match is calculated - however if you make it a group then you can extract that group and you're sorted.
/(\w+\.\w+)/g.exec("form-data; name=\"file\"; filename=\"file.txt\"")[1]
-
• #3
It's now fixed, so the latest builds will work better
-
• #4
Thank you.
I am not good at regular expressions. A better solution would be to look for the content between quotes after 'filename=' (to also get filenames without extension), but at least we spotted a small bug.
-
• #5
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 -
• #6
Hello everyone,
It seems that the quantifiers '?' and '{}' don't work'/2?\d/.exec("24") // return null rather than 24
Are they implemented ?
Thank you.
Hello everybody,
I am trying to match the second string between quotes and while it works fine on node.js it fails on espruino v1.99.
With the resources available on espruino, how else would you do it?
v2.01 is broken too.
Thank you.