怎么提取文本行中,带有大小写字母数字的行

怎么提取文本行中,带有大小写字母数字的行

文本格式a.txt 如下:
linkailin
Lklylh00
gdchenbin5
840516cb
wangdong081127
tiayulong
124548277
Luxibing
cesx444442
321456987
200019zph
2616831024
Windowsme
dadaxing@
Panfeng999
Mnbvcxz1
Zl506a90
197254999
zw105zw105
Ay105105
hnsysdldh
aiolos2005
chenwu855160
klingsoul
Eckingsoul
marioas110
longxiaoge
Hujiaying520
xusheng223
xieyuansong2005

提取结果应该是这样:
Lklylh00
gdchenbin5
wangdong081127
cesx444442
Panfeng999
Ay105105
aiolos2005
chenwu855160
marioas110
Hujiaying520
xusheng223
xieyuansong2005

带大写字母+小写字母+数字特征,整行提取出来b.txt

目前需要:查找a.txt中 字符串有大写字母+小写字母+数字特征的行,提取出来放入b.txt

该怎么写正则表达式?

这样就行了吧:[a-zA-Z]+[0-9]+
我不知道你用什么编程语言,我就写一下 Python 的吧:

import re

regex = re.compile(r'[a-zA-Z]+[0-9]+')
res = []

with open('a.txt') as f:
    lines = f.readlines()
    text = ''.join(lines)
    res = regex.findall(text)

with open('b.txt', 'w') as f:
    f.write('\n'.join(res))

我用的是Linux,我想用Linux下的正则表达式

https://c.runoob.com/front-end/854/?optionGlobl=global&optionMultiline=multiline&optionSingleline=singleline

这个 可以测试 生成代码 还可以看到代码

var pattern = /[a-zA-Z]+[0-9]+/,
    str = '';
console.log(pattern.test(str));

https://blog.csdn.net/csdn_leidada/article/details/122645165