Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Regex expression help! (java)

  • 20-12-2005 06:42PM
    #1
    Registered Users, Registered Users 2 Posts: 4,228 ✭✭✭


    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