How to trim the string with particular steps

  1. Trim the special character at the start of the string
    Then check
    2)if string starts with TBD or Number
    Then trim charcater or special character atfter the value
    3)if other than TBD or number then keep the value as it only remove the staring special character
    Input
    1)@TBD12345-34566
    2)987990~tvbn
    3)#9876788
    4)*SAD-133455

Output

1)TBD12345
2)987990
3)9876788
4)SAD-133455

Hi @Demo_User

You can use the regex expressions to extract the required output. Check the below image,

image

Hope it helps!!

Not only @the special character would be of anything

Look at their test screenshot - it identified the @, #, and *.

Hi,

Can you try the following?

 System.Text.RegularExpressions.Regex.Match(currentItem,"(?<=^[^A-Za-z0-9]*)((TBD|\d)[A-Za-z0-9]*|[A-Za-z0-9].*)").Value

Sample20230602-1aL.zip (2.5 KB)

Regards,