HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Extract a group from regular expression extractor Messages in this topic - RSS

Unregistered User
Unregistered User
Posts: 509


5/28/2023
Unregistered User
Unregistered User
Posts: 509
Is there an option for providing group number to extract. What if I wanted to capture second value and not first.
0 link
George @StresStimulus
George @StresStimulus
Administrator
Posts: 555


5/28/2023
George @StresStimulus
George @StresStimulus
Administrator
Posts: 555
StresStimulus regular expression extractors always return the first capture group.
In order to return the second group you can change first group to a non-capture group by adding ?: to the beginning of the group definition.
For example, for following regular expression: "Id"\:"([0-9]{4,})","Name":"(.*?)" To extract the Name change the regular expression to "Id"\:"(?:[0-9]{4,})","Name":"(.*?)"
0 link






Copyright © 2024 Stimulus Technology