Not quite.....
hello THIS could a test but THIS could also be a THIS longer test
I don't know the correct PHP syntax (Perl proficient) but this is a little more than a simple regex. Here's my proposed solution
which I'm sure you can code correctly. Please post the working code if you go with this so I can lean.
Get the stuff between <VAR and VAR;
$string = preg_replace('/<VAR(.*)VAR;/',$1, $string); // syntax????
//Split the contents of VAR on the ";" char; returning a 3 element array
$line = $string.split(';'); // syntax????
for ($i=0; $i<3; $i++) { // use array.length if it's a different length
//use regex to get what's inside (....)
$line[$i] = preg_replace('/$\w((.))/',$1, $line[$i]); // syntax????
// now split on ','. Returns 5 or 4 elements in this array. You only need the first 2
$subline = $line[$i].split(','); // syntax ????
// remove " from $subline[1] in array
$subline[1] = preg_replace('/\"/','',# $subline[1]);
// build the new line
$result[$i] = "<a href=".subline[0].">".subline[1]."</a>";
}
Hope it helps and, if you post the code, we both win 🙂