0
votes

I have extracted few dynamic tokens using regular expression extractor. But while extracting I am also extracted the single quotes for the values. Tried to remove but not working, the details below

Regular Expression I'm using is : activityId:(.*) & antiForgeryToken:(.*)

My Sample response is below:

<script type="text/javascript">
    var apiphany = {
        globals: {
            amChartsImageUrl: '/Themes/Portals.Themes.Bootstrap/Styles/AmCharts/',
            amMapsImageUrl: '/Themes/Portals.Themes.Bootstrap/Styles/AmMaps/',
            activityId: 'c703f6bf-2896-4450-8ad4-83647b7081b9',
            appPath: '/',
            antiForgeryToken: '9R64vQcEkN2OTYL-gyJT177W9RGQjK3_yV_ueyJCmSJfo6fRSJ7vD74yFe3tuDtHjEj77P5jIoYXvZTYIv4vRR3kWXzFW1b4sAeSNjZmxe3HnNTXWtwoqUePlSoQ82Lx5kdxxDw7eXTNdJmGUmGm7g2'
        }
    };
</script>

After using the above regex I am getting

2020-04-22 12:00:02,034 INFO o.a.j.u.BeanShellTestElement: -----------> 'fbd7d2dd-fc7b-4054-914f-e1ea582eeb23'
2020-04-22 12:00:02,034 INFO o.a.j.u.BeanShellTestElement: -----------> 'hoYd5BSNsGX7Lt0WwtWjiWrnB2D-PQHLTB375N6hZF1QR7g3f_8wVvgK8XXFnz2mdeyk' (partial-string)

Also in the debug smapler I am getting the same,

Activity_Id= 'fbd7d2dd-fc7b-4054-914f-e1ea582eeb23'
Anti_Forgery_Token= 'hoYd5BSNsGX7Lt0WwtWjiWrnB2D-PQHLTB375N6hZF1QR7g3f_8wVvgK8XXFnz2mdeykTWnNVuKg61eKZydnq9fjfyEjw' (partial-string)

enter image description here enter image description here enter image description here

1
You are capturing the ' in the group. You could first match it activityId:'([^']*)'The fourth bird

1 Answers

0
votes

To remove it you need to include the space and quotes (unwanted characters) in the regular expressions:

activityId: '(.*)'
antiForgeryToken: '(.*)'