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.

Regular Expression

  • 29-03-2007 07:58PM
    #1
    Closed Accounts Posts: 49


    Hey guys,

    Im trying to put together a regular expression to search through a string for letters in a spacific place in the string....for example, if im looking for "o", "a" and "s" in "boards", i would have to put in "o1", "a2" and "s5"....

    Heres what i have already but it wont work:
    val4.append("[" + letters.get(x) + "]" + "\\" + numbers.get(x));
    

    val4 is a StringBuffer that is appended for every segment (i.e. "o1" etc...)


    I get this error: "No such group yet exists at this point in the pattern near index 9"


    It looks like this in the output: [o]\1[a]\2\5

    Cheers


Advertisement