I'm trying to learning about pattern matching with jQuery and I had a question...
In php, I can do something like this:
$find = array("-", "_", "+");
$replace = array("X", "Y", "Z");
$string = "The alphabet ends in -, _, +";
$newstring = str_replace($find, $replace, $string);
Which will yield: The alphabet ends in X, Y, Z
Is there a way to accomplish this with jquery? Where I can define an array of values to search for and replace them with the values in another array? I get that I can do a replace(/pattern/, "Something"), but was hoping for a way to duplicate this php code in jquery?