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

Regular Expression

  • 29-03-2007 7: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