Hi,
I want to populate markdown block quotes inside $Text to a specific attribute $Qotd
The block quotes are in a regular format (and the quotation marks are in the text):
> "This is a quote."
The following code works as expected:
if($Text.contains("^> (.+)\n")){$Qotd=$1;}
and $Qotd
becomes "This is a quote."
(i.e. it includes the original quotation marks.)
But if I try to remove the quotation marks in the output by escaping them in the pattern with:
if($Text.contains("^> \"(.+)\"\n")){$Qotd=$1;}
then the search still works, but the back reference doesnāt and I get $Qotd=$1
.
The real code traps for failure, so I know the escape syntax is correct and the pattern is being found: itās the back reference which doesnāt work.
I know I could simply post-process $Qotd to strip the first and last character, but Iām interested to know:
Have I got the syntax wrong, or do " simply not work with back references?
Many thanks!
David