Regular Expression help

Hi,

Need help to write some Regular expressions.

  1. Input string - 07CRo.456778 (the length after digit wil be varying example 07CRo.23, 07CRo.xcv4445efefe)
    Expected - 456778 (need the string after the decimals)

  2. I want to get last n digits in the given number…
    123456789 (last 6 digits of the number - 456789)
    the lengt of the number will be varying

Thanks
Sunny

  1. Use WmPublic - tokenize built in service with a delimiter as “.” and read the 2 entry in the string list. That will give all the digits after the decimal…

Hi Bhavani,

Thanks for the info.
could you please let me know how to capture the string list[1] in the pipeline.

Sunny

Map the stringlist to a string and double click the map line and in the second tab, set the array index to 1.

or

create a new string and set value with the following %valueList[1]% and click on Perform Variable substitution. (assuming the valueList is the output from tokenize)

Regarding the second problem, one approach could be :
Determine the length -
Subtract the number of digits you want to extract from the above length and assign it to “startPos”
Use substring with the above “startPos”.
Leave the endPos empty, as you need to read till the end

HTH
Bhavani Shankar

Thanks a ton Bahavani …