Last active
March 15, 2019 10:36
-
-
Save taikulawo/eed2f639decf877aae042a194ae5146b to your computer and use it in GitHub Desktop.
for-deng-ruo-qi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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