正则表达式

求教如何从正则表达式

输入:洁(80)  08:43:12   34级卡30468458  升A卡0010498    诸范德萨33030319520345603X"

获取:洁  30468458  0010498   33030319520367773X

^(.+?)(?=\(\d+\))[\S\s]+?级(\d+)[\S\s]+?(\d{17}[xX\d]).*?卡(\d+)

^([\u4e00-\u9fa5].).*?(\d{8}).*?(\d{7}).*?([0-9Xx]+)

^([\u4e00-\u9fa5].).*?(\d{8}).*?(\d{7}).*?([0-9Xx]+)
^(.+?)(?=\\(\\d+\\))[\\S\\s]+?卡(\\d+)[\\S\\s]+?A卡(\\d+).*?(\\d{17}[xX\\d])

 

1 Matcher matcher = Pattern.compile("^(.+?)(?=\\(\\d+\\))[\\S\\s]+?(\\d+)[\\S\\s]+?卡(\\d+)[\\S\\s]+?(\\d{17}[xX\\d])").matcher(str);

 

 

posted @ 2022-03-23 16:06  dafengchui  阅读(29)  评论(0)    收藏  举报