Product code looks like abcd2343, what to split by letters and numbers

后端 未结 6 919
不知归路
不知归路 2020-12-02 18:34

I have a list of product codes in a text file, on each like is the product code that looks like:

abcd2343 abw34324 abc3243-23A

6条回答
  •  执笔经年
    2020-12-02 19:02

    Try this code it will work fine

    import re
    text = "MARIA APARECIDA 99223-2000 / 98450-8026"
    parts = re.split(r' (?=\d)',text, 1)
    print(parts)
    

    Output:

    ['MARIA APARECIDA', '99223-2000 / 98450-8026']

提交回复
热议问题