regex - matcher in java not yielding desired output -
nodenname = vas_del_sdc_lb1_onm_del_10.200.98.74; private string extractnodename(string nodename) { string output = ""; matcher match = pattern.compile("[0-9]+").matcher(nodename); while (match.find()) { output.split(match.group()); } return output; }
can me out extracting vas_del_sdc_lb1_onm_del
, above tried not working
private string extractnodename(string nodename) { string output = ""; matcher match = pattern.compile("\\w+(?<!\\d|_)").matcher(nodename); while (match.find()) { output = match.group(); } return output; }
result: vas_del_sdc_lb1_onm_del
Comments
Post a Comment