Espruino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 593|回复: 0

官方固件1v95版本支持正则表达式

[复制链接]
发表于 2018-2-18 16:07:34 | 显示全部楼层 |阅读模式
官方固件1v95版本支持正则表达式
http://www.espruino.com/Reference#RegExp

Regular Expressions
They're here - finally! On all official Espruino boards (and many others, if there's enough memory).
While it's not 100% full support, it's enough for the majority of things, with String.indexOf, String.split, RegExp.exec and crucially String.replace - even with the ability to specify a function as the replacement.

>"Hello world".replace(/l/g, function(match,idx) { return "[L"+idx+"]"; })
="He[L2][L6]o wor[L15]d"

官方固件1v95版本完整release note链接:
http://forum.espruino.com/conversations/314627/
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|Espruino中文社区 ( 苏14007051 )

GMT+8, 2018-12-13 21:06 , Processed in 0.192447 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表