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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -