11 Jun 2019 12:09 PM - last edited on 30 Nov 2021 08:40 AM by MaciejNeumann
Hi,
We have an application that some of its page titles are comprised of the following structure:
371000 037386109 1440
We want (if possible) to be able to make the user action name include only the first and last part of the title, i.e. 371000 1440.
Being novice in regex and knowing only one capture group is possible, is that even possible ?
Gil.
Solved! Go to Solution.
11 Jun 2019 12:56 PM
This regex should work for your case:
(\d+) \d+ (\d+)
and the replacement string is
$1 $2
However, it cannot be used in the extraction rule, since that rule allows only one capture group. But you can use it in the cleanup rule.
This is unfortunately very unintuitive and took me a while to figure out how to use multiple capture groups for user actions.
11 Jun 2019 01:18 PM
Thanks @Julius L.
However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?
12 Jun 2019 05:48 PM
Yes, that's correct. I overlooked that information from your first post. Sorry.
I don't think there is a solution right now to extract two capture groups and define user action from other metadata than URL. You can use the JS API to name your action (if it's suitable for your case). Isn't it possible to capture the information you need from another place?
There another much more powerful rule engine for user actions planned, but I don't know when this is going to be available.
11 Jun 2019 01:17 PM
Thanks @Julius L.
However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?
30 Nov 2021 07:32 AM
Correct. In 2019 when old user action naming rules style was in place, this was the case and regex were applicable only in URLs.
Not anymore with the current user action naming where regular expressions and extractions can be used for any placeholder.