javascript - node.js regex splitting a string to send to another server -
i'm trying split type of string in node.js send information 1 server another. i'm having trouble getting regular expression work considering kind of stink @ regular expressions in node.js or language @ moment. i'm trying make easier on myself without having bunch of strings replace or split array. so, here's string:
?name!identity@url.url
is possible name string without .replace() , .split()?
using matching groups:
var mystring = "?name!identity@url.url"; var myregexp = /\?(.*?)\!.+?/g; var match = myregexp.exec(mystring); if(match) { alert(match[1]); // name } else { alert("no match"); }
Comments
Post a Comment