There are now finally regular expressions in Espruino! If you download a cutting edge build then you should get them.
There's:
/regex/ syntax to define them
Or `new RegExp("regex")
regex.exec to match on a supplied string
string.replace(regex, replacement)
string.split(regex)
It's not got all the RegEx functionality built in, but should cover most of the common use-cases.
Let me know how it goes! The RegEx system might still need some work, so if you find a RegEx that doesn't seem to be working properly, please let me know!
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.
There are now finally regular expressions in Espruino! If you download a cutting edge build then you should get them.
There's:
/regex/
syntax to define themregex.exec
to match on a supplied stringstring.replace(regex, replacement)
string.split(regex)
It's not got all the RegEx functionality built in, but should cover most of the common use-cases.
Let me know how it goes! The RegEx system might still need some work, so if you find a RegEx that doesn't seem to be working properly, please let me know!