cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

help with regex for user action extraction rule

gilgi
Advisor

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.



4 REPLIES 4

Julius_Loman
Leader

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.


Thanks @Julius L.


However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?


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.


gilgi
Advisor

Thanks @Julius L.


However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?