Can I capture a group from my text-filter regex?
I am looking to create a report on pages that include a certain macro. More specifically, I want to report those pages, and the parameters they pass that macro. I am able to create a report using the text-filter macro looking for a regex that explains the macro for the report. However, I would like to use groups in that regex, to capture the parameter, but do not know how to capture that group. Is there a way to do this?
Here's a sample of my code:
{content-reporter:spaces=pplpmpmain|types=+page}
{text-filter:content:body|include=(?i).*\\\\x7Bppl-use-image:.*(require).*\\\\x7D.*}
{content-reporter}
It currently shows static text in the group, but going forward, I will make this a group of alpha characters, and then try to capture those characters.
Thanks in advance!
Trish
Here's a sample of my code:
{content-reporter:spaces=pplpmpmain|types=+page}
{text-filter:content:body|include=(?i).*\\\\x7Bppl-use-image:.*(require).*\\\\x7D.*}
{content-reporter}
It currently shows static text in the group, but going forward, I will make this a group of alpha characters, and then try to capture those characters.
Thanks in advance!
Trish
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?Hi Trish,
Sorry for the delay in answering this. You can't access the capture group from the {text-filter} macro itself, but you can use the 'text:match XXX' key with the regular expression to access it from inside the {report-body}. For example, expanding on your code, try something like this:
{report-table}
{content-reporter:spaces=pplpmpmain|types=+page}
{text-filter:content:body|include=(?i).*\\\\x7Bppl-use-image:.*(require).*\\\\x7D.*}
{content-reporter}
{report-column:title=Captured}{report-info:content:body > text:match "(?i).*\\\\x7Bppl-use-image:.*(require).*\\\\x7D.*" > match:group 1}{report-column}
{report-table}
Hope that helps!
Loading Profile...



EMPLOYEE