🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Extracting a number from a string under specific conditions

User: "paolochip"
Altair Employee
Updated by Jocelyn
Hi,
I'm struggling on doing something that looks easy (and maybe dumb), but I don't find a way. I need to extract a number from a string that matches specific conditions. I have a column with different strings like:

John Alpha U23
Mike Beta C57
Ann Cole U73456
Amy Utta J94857

I want RM to create a new colum that picks only numbers where there is the U in front and leave blank (or put something like none) on the other rows

23
none
73456
none

I'm not able to uniquely identify strings that contains both U and a number after. Is there a way to do that without using python or generativeAI blocks? By using a Split block with a regular expression like [^U[0-9]]{1,} it picks also the U of Amy, while I want select U only if it has followed by a number.

Thanks,
Paolo

Find more posts tagged with