Is there a way to replicate this PHP snippet in JQuery or Javascript…
<?php
$A = preg_match_all('#{.*(.*)}#U', $value, $B); //matches all between {} put it into array "B"
$C = $B[1]; // array[0] = "{content}" --- array[1] = "content"
?>
I have been trying to find something similar for like 4 hours or so to no avail.
The goal is basically to find everything between { and } and then pull that information out to be useful.
I am no Javascript expert so I would appreciate any help. Thank you in advance.
You can get all blocks of text between { and } into an array with this:
Working demo: http://jsfiddle.net/jfriend00/DT4Km/