Item13051: Cannot do anything useful with a $pattern that contains a quote (").
Priority: Enhancement
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: SEARCH
Branches: master
If you use a search to locate a topic and then process the topic content using a $pattern, if that $pattern returns a result that contains a " you can't do anything with it - the " will be interpreted as part of the parameter syntax for any macro you call it within.
"Example":
%SEARCH{"Dagnabbit" topic="Item13051" format":$pattern(.*?(.Example.).*):"}% will return
:"Example":
Number of topics: 1
Because the "'s come from the $pattern-matched string (and there's therefore no way to escape them) then this result can't safely be used in a parameter to any other macro
We require some way to tell $pattern to escape the result.
--
CrawfordCurrie - 10 Oct 2014
Added $extract to do the job without damaging $pattern.
%SEARCH{"Dagnabbit" topic="Item13051" format":$extract(.*?(.Example.).*):"}% will return
:"Example"$:
Number of topics: 1
--
CrawfordCurrie - 31 Oct 2014