Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Regex expression help! (java)

Options
  • 20-12-2005 6:42pm
    #1
    Registered Users Posts: 4,222 ✭✭✭


    Argh. i do hate regex. have needed to do it in ages.
    Have a string that contains numbers, letters and other characters like . and /.
    e.g.
    string1 = "26158 25580 12.0  2.0 /bin/sh ./start.sh"
    

    That i want to split up into an array. The criteria for the split is 1 or more space chatacters so i should have an array like
    ["26158","22580","12.0","2.0","/bin/sh","./start.sh"]

    anyone know what the regex is for a match basec on one or more characters?
    tried
    Array temp[] = string1.split("^[  ]+");
    
    but that doesnt work..


Comments

Advertisement