String manipulation using regex


#1

Hi ,

I had the string value like “P12334545Something” in this value I need only Something from this string I don’t know first letter and numbers will be same how to get Something if anyone know let me give an idea.
Thank you.


#2

Hey @Spark_robot

Will the number of characters before “Something” be the same everytime?
That is 9?


#3

Hi @Rishabh_Lakhera

Yes it will be 10 digit for all


#4

Hi, I think the Regex activity ‘Matches’ with the following in the pattern criteria, “(?<=P12334545).*” would work. Do note that the result would be an IEnumerable.


#5

A more general alternative would look like that:
(?<=\w\d{8}).+
It will match anything after 1 letter and 8 digits

Another way:
(?<=.{9}).+
This will simply match anything after 9 characters


#6

Then you could just write str.Substring(9) that will give you evrythng after 5, “Something” in this case!


#7

Thank you, once got value I ll inform