aaa---bbb-ccc
aaa.bbb.ccc
def objective = "aaa---bbb-ccc" objective.replace(/.*[-]+.*/, '.')
def objective = "aaa---bbb-ccc" objective.replace(/[-]+/, '.')
(.*?)-+(.+?)-(.*)
$1.$2.$3
def objective = "aaa---bbb-c" objective.replace(/(.*?)-+(.+?)-(.*)/, '.')
objective.replace(/(.*?)-+(.+?)-(.*)/, '$1.$2.$3')
var x = "123---abc-d"; var y = x.replace(/(.*?)-+(.+?)-(.*)/, '$1.$2.$3'); alert(y);
println( objective.replace(/(.*?)-+(.+?)-(.*)/, '$1.$2.$3') )
println( objective.toString().replace(/-/, '.') )
aaa...bbb.c
(/[-]+/, '.')
"replace"
"replaceALL"
def objective = "aaa---bbb-c" println( objective.replaceAll(/[-]+/, '.') )
def objective = "---aaa---bbb-c--" objective.replaceAll(/[-]+/, '.').replaceAll( /^[\.]+(?=)|(?<=)[\.]+$/, '')
def objective = "----.,,,aaa-,,,, ...--bbb-,.. c-- --" println( objective.replaceAll(/[- \.,]+/, '.').replaceAll( /^[ \.,]+(?=)|(?<=)[ \.,]+$/, '') )
/^[ \.,]+(?=)|(?<=)[ \.,]+$/
/^([ \.,]+)(?=)|(?<=)\1$/
/^(?<name>[ \.,]+)(?=)|(?<=)\name$/
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)