Suppose I have a string: 997 668, now I need to remove anything before space i.e I need 668 as the output. I need a solution using regular expression. Now I am using the below:
x = '997 668'
x = x.split(' ')[1]
Above also give the output but fails when there is only one number, if x = 555 then output comes blank which I dont want.
See Question&Answers more detail:os