我有一个非常复杂的函数输出,我需要使用它的特定单词。Java字符串分割多个字符分隔符
对于例如,我输出是:
oracle 11257 1 0 14:01 ? 00:00:00 ora_pmon_sas
我需要得到公正 “sas
” 字样,这是旁边的 “ora_pmon_
”
又如:
oracle 6187 1 0 13:41 ? 00:00:00 ora_pmon_db2
我需要得到“db2
”。那么我应该怎么表达?
Java代码:
insArray=line.split("what will be between these quotes?");
为什么如果该模式只发生一次,你分裂了!..它有多个这样的模式。 。请问你的问题非常具体.. – Anirudha
'input.substring(input.lastIndexOf('ora_pmon_')+ 1)'会做诡计...... –
好吧,可能会有另一个词,如“asm_pmon_”而不是“ ora_pmon_”。但其余的事情是相似的。 – AloneInTheDark