Regex Community, programming Development

Hi!

I'd like to search and replace in Google Analytics view filter all my Request URIs in such a way that just the article id remains (plus, to add an "a-" before the ID).

Example URIs:

/raksts/sievietem/281750-ilona-balode-par-dzivi-ar-udriti-no-mums-beg-ka-no-grimstosa-kuga

/raksts/zinas/281427-video-izskatas-ka-spelu-automatu-atkariba-baibu-strautmani-nelaiz-vala

/raksts/arzemes/282070-pasauli-savilno-mazas-princeses-sarlotes-emocijas-karaliskajas-kazas

/raksts/izklaide/280379-turpinas-tirisana-jrt-maru-kimeli-atlaiz-hermana-sieva-aiziet-pati

The result I'm after:

a-281750

a-281427

a-282070

a-280379

Here it works like a charm, Regex being:

'\/raksts\/\D+(\d+).+'

Substitution being:

'a-$1'

But when I apply them to a GA filter, the checker tells me that the filter wouldn't have changed any data.

Not sure if I need to do this in GA - Data Studio would do too, the endgame being exported article IDs for our IT guys to implement in our editorial interface through Google API.

Probably a dumb question for which I apologize, but really stuck, so any help would be appreciated.

kmuravjovs () - 5 years ago - Reply 0