Let's say I have this string: This is `my <string>` that I want to modify because the angle bracket is between backticks
I want to turn it into this: This is `my <string>` that I want to modify because the angle bracket is between backticks
And: This is `a <string> I don't want to modify because it's not between backticks
But making this even trickier: This is \`another <left_angle_bracket>`I don't want to modify because the first backtick is escaped but I do want to modify <the_last_left_angle_bracket>` between the backticks
This could probably be done with a hairy regex but I'm guessing there's a cleaner way to parse the string and make the appropriate substitution.
Any suggestions?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Replacing left angle bracket with HTML entity when between two backtick characters by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |