Let's say I have the string:
var post = "[PostContent(postId=123e4567-e89b-12d3-a456-426655440000, postName=My New House, picture=house.jpg, location=San Francisco)]"
What I'm trying to rip out is the UUID from the postId so the new resulting string just has the value:
123e4567-e89b-12d3-a456-426655440000
Thanks for the help!
Update:
Sorry for the incomplete question I've already tried:
var firstvariable = "postId=";
var secondvariable = ", postName=";
string.match(new RegExp(firstvariable + "(.*)" + secondvariable));
and
string.substring(string.lastIndexOf("postId=")+1,string.lastIndexOf(", postName"));
and
var regex = /(.*postId=\s+)(.*)(\s+, postName.*)/;
var newtext = string.replace(regex, "$2");
postId=([\w-]+)regex