我是使用正则表达式的新手,我有类似的字符串
ELEMENTS'"MCMCU","MCSTYL","MCDC","MCLDM","MCCO","MCAN8","MCAN8O","MCCNTY","MCADDS","MCFMOD","MCDL01","MCDL02","MCDL03","MCDL04","MCRP01","MCRP02","MCRP03","MCRP04","MCRP05","MCRP06","MCRP07","MCRP08","MCRP09","MCRP10","MCRP11","MCRP12","MCRP13","MCRP14\
","MCRP15","MCRP16","MCRP17","MCRP18","MCRP19","MCRP20","MCRP21","MCRP22","MCRP23","MCRP24","MCRP25","MCRP26","MCRP27","MCRP28","MCRP29","MCRP30","MCTA","MCTXJS","MCTXA1","MCEXR1","MCTC01","MCTC02","MCTC03","MCTC04","MCTC05","MCTC06","MCTC07","MCTC08","\
MCTC09","MCTC10","MCND01","MCND02","MCND03","MCND04","MCND05","MCND06","MCND07","MCND08","MCND09","MCND10","MCCC01","MCCC02","MCCC03","MCCC04","MCCC05","MCCC06","MCCC07","MCCC08","MCCC09","MCCC10","MCPECC","MCALS","MCISS","MCGLBA","MCALCL","MCLMTH","MCL\
F","MCOBJ1","MCOBJ2","MCOBJ3","MCSUB1","MCTOU","MCSBLI","MCANPA","MCCT","MCCERT","MCMCUS","MCBTYP","MCPC","MCPCA","MCPCC","MCINTA","MCINTL","MCD1J","MCD2J","MCD3J","MCD4J","MCD5J","MCD6J","MCFPDJ","MCCAC","MCPAC","MCEEO","MCERC","MCUSER","MCPID","MCUPMJ\
","MCJOBN","MCUPMT","MCBPTP","MCAPSB","MCTSBU"'
我想提取"text1", text2,.....,"textn"
;我试过了
Pattern p = Pattern.compile("^ELEMENTS\\s'\".*\"'$",Pattern.MULTILINE);
Matcher m = p.matcher(s);
但它不仅适用于一行字符串