Extract string from variable

Hi there. I have a variable which is filled with a string:

/Playmobil-6872-Polizei-Kommandozentrale-mit-Gef%C3%A4ngnis/dp/B01608LOHS/ref=sr_1_1?keywords=4008789068729&qid=1641504153&sr=8-1

Now I am looking for a possibility to extract the B01608LOHS and store this in another variable.
Is there any possibility?

Thank you in advance

It looks like you are using Katalon Recorder so I’m not sure if you can use the same technique as the following.

@rmarcelr

Is it always a fixed string? If that’s the case, I’d say the first step to get there is to use storeEval to execute a javascript to retrieve the desired substring knowing its position.

So I am using Katalon Recorder right. I think I can not work with your technique. I am new to this so I dont have a clue where to implement your strategy.
Thanks

Thank you for your answer. What do you mean by fixed string? Always the same length? No, definitely not. But its always the same pattern. Everytime there is a /dp/ in front of my desired string and everytime there is a / after my desired string.

Beside of this: do you have a nice an beginner friendly documentation about executing a javascript. I am new to this so I am not very experienced how to ingest code in this way.
Thank you

1 Like

Wow. This looks so easy. Thank you very much :metal: