[英]How to get all numbers after the last occurrence of a non numeric character in Python
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
Say I have the string说我有字符串
100D555
100D555
How can I split this string in python to be left only with '555' at the end?如何将 python 中的这个字符串拆分为最后只留下“555”? The strings I am operating on follow the same format roughly: x amount of numbers, followed by one non numeric char, followed by z amount of numbers.
我操作的字符串大致遵循相同的格式:x 个数字,后跟一个非数字字符,然后是 z 个数字。 Another example:
另一个例子:
10M4567 In this case I would want '4567'
10M4567 在这种情况下,我想要“4567”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.