The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Extracting a number from a string under specific conditions
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
Tagged:
0
Answers
Dortmund, Germany
xkcd: Regular Expressions