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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

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

javascript - Restarting Supervisor and effect on FlaskSocketIO -