Igor_Zip
(Igor Zip)
January 18, 2019, 12:57pm
#1
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 “&”?
McStar
(Максим Таран)
January 18, 2019, 1:15pm
#2
Igor_Zip:
click=(.+?)&
Just get group 1 from result.
1 Like
McStar
(Максим Таран)
January 18, 2019, 1:21pm
#3
Or that: (?<=click=)(.+?)(?=&)
1 Like
BabyRoot
(Vasily)
January 18, 2019, 1:24pm
#4
&click=([\w\W]+)&mysuffix
1 Like
Igor_Zip
(Igor Zip)
January 18, 2019, 2:26pm
#5
how i can get group 1 from reslt?
Igor_Zip
(Igor Zip)
January 18, 2019, 2:27pm
#6
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
Kokoch
(Bohdan B)
January 18, 2019, 4:03pm
#7
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]);
McStar
(Максим Таран)
January 21, 2019, 8:18am
#9
It’s another regex, that I have wrote.
BabyRoot
(Vasily)
January 21, 2019, 10:34am
#10
Максим, вы мой вариант из каких побуждений игнорируете?
McStar
(Максим Таран)
January 21, 2019, 10:52am
#11
Я??? Вопрос не я задавал.