How can I code the dcrum regex to match a certain string in the url and not get garbled ADS output?
The url is this:
https://dreambaby2.dreambaby.be/wps/myportal/nl/aanbieding/gratis-pampers...ect
As we Belgians are multiple-linguistic this url can have multiple appearances:
in Dutch:
https://dreambaby2.dreambaby.be/wps/myportal/nl/aanbieding/gratis-pampers...ect
in French:
https://dreambaby2.dreambaby.be/wps/myportal/fr/offre/pampers-gratuit...ect
Also, depending on being logged-in or not, 'myportal' can also be 'portal'
I coded the dcrum regex as:
(https?://dreambaby2.dreambaby.be/wps/(portal|myportal)/(nl|fr)/(aanbieding|offre)).*
This seems to fit all possible urls for this case, but the ADS output is not what I expect, due to the use of brackets:
https://dreambaby2.dreambaby.be/wps/myportal/nl/aanbiedingmyportalnlaanbieding
I would expect it to be:
https://dreambaby2.dreambaby.be/wps/myportal/nl/aanbieding
Of course I could code all languages separately, but as there are multiple urls to process the list can grow quite long.
Wim.
Answer by Pawel B. ·
Please remember that you can still use Page Titles or other HTML tags to name your transactions. Than, url becomes just a parameter. You can also build your transactions in the report server where you can add operation (url) string rules to transaction definition.
Answer by wim d. ·
OK.
For the time being I will code every URL separately (the last part also has 2 language equivalents and this is the main cause for bad matches).
Is there any chance that this will change in a future release?
Wim.
Wim,
It looks to be possible anyway.
Try:
(https://dreambaby2.dreambaby.be/wps/(?:myportal|portal)/(?:fr|nl)/aanbieding)
"?:" mans that the content of this bracket contains alternatives of words.
It's will not be testable in RUM Console but will work when saved and sent to the AMD. Applications.xml file fill recognize it and let RTM process use it.
Sorry for the confusion.
Answer by Adam P. ·
For the example only with "portal", "myportal", "fr" and "nl" variations it would be:
(https://dreambaby2.dreambaby.be/wps/[myportal]*/[frnl]{2}/aanbieding)
As round brackets in DCRUM are used for selecting the part of string that should be reported so there might be a problem to use it for aternatives like "(one|two)". We're lucky that "myportal" overlaps "portal" ...
I will make sure what to do if we need to use (myportal|noportal) alternative and let you know.
Hi Adam,
coding with square brackets does not prevent getting a match for
https://dreambaby2.dreambaby.be/wps/mrtal/fn/aanbieding
|
which is not what I want.
Wim.
I know, but our regexes does not allow to provide an alternatives of full phrases ...
So either you decide to use:
Definition for "portal", "myportal" and "ymportal" |
(https://dreambaby2.dreambaby.be/wps/[my]*portal/[frnl]{2}/aanbieding) |
and take a risk to have "ymportal" (is there really such URL?),
or
you provide as many definitions as many "myportal" and "portal" phrases you have:
Definition for "portal" |
(https://dreambaby2.dreambaby.be/wps/portal/[frnl]{2}/aanbieding) |
Defeinition for "myportal" |
(https://dreambaby2.dreambaby.be/wps/myportal/[frnl]{2}/aanbieding) |
JANUARY 15, 3:00 PM GMT / 10:00 AM ET