Help with a regex query

hi all,

i am trying to write a regex query that will run from a text. the first problem i have is that i can not get the results of the query that i want

taking the text below i am trying to get everything from
test_id:501
down to
@run_id:101
and then store that as variable

do not need 1
Do not need 2
do not need 3
do not need 4

@run_id:101 @suite_id:102 @test_id:501 @case_id:10001 @run_id:101 @Automated
what 1 want 1
what 1 want 2
what 1 want 3
what 1 want 4
what 1 want 5
what 1 want 6
what 1 want 7

@run_id:101 @suite_id:102 @test_id:502 @case_id:100002 @run_id:101 @Automated
do not need 5
Do not need 6
do not need 7
do not need 8

i was hoping that someone may have a few suggestions. i have tried a few different combinations but it is not working for me

thanks,
regex test.txt (459 Bytes)

Hi @adrian_sullivan
Please share the text file and the requirement what you want to extract.
Regards,

@adrian_sullivan

Are you trying to get the case id?

Cheers

text file is there now

what i want is

501 @case_id:10001 @run_id:101 @Automated
what 1 want 1
what 1 want 2
what 1 want 3
what 1 want 4
what 1 want 5
what 1 want 6
what 1 want 7

thanks

Hi @adrian_sullivan
Try using the following regex expression:

(?<=@test_id:)(.*)\s+(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)

Hope it helps!!
Regards,

that is a step in the right direction

how would i get it it to as far as suite id

thanks

@adrian_sullivan

Do you want to extract the following below text:
@run_id:101 @suite_id:102

Regards,

everything between test id 501 and suite id 102

the number of lines to be extracted will keep changing, sometimes 5 lines sometimes 25 lines