Skip to content

Instantly share code, notes, and snippets.

@taikulawo
Last active March 15, 2019 10:36
Show Gist options
  • Save taikulawo/eed2f639decf877aae042a194ae5146b to your computer and use it in GitHub Desktop.
Save taikulawo/eed2f639decf877aae042a194ae5146b to your computer and use it in GitHub Desktop.
for-deng-ruo-qi
;(function(){
const match = /(=g[^=]*=)*/g
function transform(s) {
/* code */
let res = s.match(match)
return Object.keys(res).reduce((prev,next) => {
let curr = res[next]
if(curr){
prev.push(`<g>${curr.substring(2,curr.length - 1)}</g>`)
}
return prev
},[])
}
let b = transform('=g1.23 联调(-1)=,=g1.25 发布(+1)=')
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment