简体   繁体   中英

Regular Expression in Google Analytics for two parts of string

I need to filter data in Google Analytics based on a regular expression.

I need to say "If the string contains "/secure//secure/common/callback" AND, further down the string contains the words "true" then include it.

I tried this: ^/secure//secure/common/callback*true

I added to start to say there is a bunch of text in between "callback" and "true" but it returns zero when it should return thousands of records.

What regular expression would I use here?

Use this:

^/secure//secure/common/callback.*?true

. means any character
.* means any character repeated O or more times
.*? has same meaning except that it is not greedy, it matches the less amount of characters as possible, usefull if you have more than one matching ( true in this case) in your string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM