Regullar expresions how to exclude some symbols

I have a string:

https://play.google.com/store/apps/details?id=air.com.littlebigplay.games.premium.plurals&click=541255b82bc957475c7b6222d1a980a5&mysuffix={HELLO_WORLD}&optid=541255b82bc957475c7b

I need 541255b82bc957475c7b6222d1a980a5 - (I want to extract click)/ I use next regex click=(.+?)& but it take &click=541255b82bc957475c7b6222d1a980a5& .

How I can extract without “click=” and “&”?

Just get group 1 from result.

1 лайк

Or that: (?<=click=)(.+?)(?=&)

1 лайк

&click=([\w\W]+)&mysuffix

1 лайк

how i can get group 1 from reslt?

i need to use regex in postman

const $ = cheerio.load(pm.response.text())
var val1 = $(‘script’).text();
var val2 = val1.match("(?<=click=)([^&]+)")
console.log(val2);

pm.environment.set(’{transaction_id}’, val2)

i use that? but it is not working

var str = 'https://play.google.com/store/apps/details? id=air.com.littlebigplay.games.premium.plurals&click=541255b82bc957475c7b6222d1a980a5&mysuffix={HELLO_WORLD}&optid=541255b82bc957475c7b';

var reg = /click=(\w+)&/

console.log(str.match(/click=(\w+)&/)[1]);
=([0-9a-f]){6,}&

It’s another regex, that I have wrote. :slight_smile:

Максим, вы мой вариант из каких побуждений игнорируете?

Я??? :slight_smile: Вопрос не я задавал. :slight_smile: