I would like to use regular expression language to get a new list with only num_num and delete everything after the second _.
I am not practical with this language. How can I do it?
Thank you all
Until somebody with Regex expertise might provide guidance specific to your request …
truncateString.dyn (12.2 KB)
I would do the @Vikram_Subbaiah,
stringval = "14_102_ui(2)_more_under_scores" delimiter = "_" output = stringval.split(delimiter, 2) print output + delimiter + output #output = 14_102
but if regex is what you want:
Well if we’re putting options on the table:
(edited to add yet another option - down to one line of design script)
Using the expression @3Pinter provided, within a python example.
import re input = IN result =  for i in input: result.append(re.split("^(.*_.*)_.*",i)) OUT = result
Thank you all!
Your answers are all solutions.