Regullar expresions how to exclude some symbols

Теги: #<Tag:0x00007f7b62230700>

(Igor Zip) #1

I have a string:{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 “&”?

(Максим Таран) #2

Just get group 1 from result.

(Максим Таран) #3

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

(Vasiliy Rakshin) #4


(Igor Zip) #5

how i can get group 1 from reslt?

(Igor Zip) #6

i need to use regex in postman

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

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

i use that? but it is not working

(Bohdan B) #7
var str = '{HELLO_WORLD}&optid=541255b82bc957475c7b';

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


(Sergey Rybakin) #8

(Максим Таран) #9

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

(Vasiliy Rakshin) #10

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

(Максим Таран) #11

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