Need to Extract a Required String from a total string

Hi,

I have a requirement where I have to extract the required string like “ABCDEFG123456789” from a total string.

The required string is fixed in length and will always start with ABCDEFG followed by 9 digits with no space in between as in above format but can appear anywhere within the total string like at the beginning of total string, middle of total string or at the last of total string.

Please suggest how to extract the required string.

Thank you,

Pritam

@PritamK0 Could you check if you can make use of Ruta scripts. Pegasystems Documentation

@PritamK0

Could you try below configuration and see if it works

@pxReplaceAllViaRegex(Param.Input,Param.Regex,Param.StringToInsert)

Param.Input HelloWorldABCDEFG987654321TestThis

Param.Regex .([A-G]{7}[1-9]{9}).

Param.StringToInsert $1

Code snippet for your reference

@SanthoshRanga Thank you for replying but it does not work for HelloWorldABCDEGA987654321TestThis.

I mean if the characters are in random order or repeat but for numbers it works.

Please suggest.

@PritamK0

I see its still working for value HelloWorldABCDEGA987654321TestThis as well.

Could you please check below code snippet.

@PritamK0

Did it worked ?

@SanthoshRanga Apologies for the late reply. Yes it worked. Many many thanks to you.