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

后端 未结 6 935
不知归路
不知归路 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:18

    def firstIntIndex(string):
        result = -1
        for k in range(0, len(string)):
            if (bool(re.match('\d', string[k]))):
                result = k
                break
        return result
    

提交回复
热议问题