Getting substring by regex

Discussion in 'Java' started by Christine Mayer, Sep 6, 2007.

  1. Hi, I got a String that is composed of digits, white space, numbers
    and other characters.
    Example: 03... London (first two digits of post code, plus 3 dots for
    the remaining digits).

    I want to go through the String and search for the first occurrence of
    a letter (A-Za-Z).
    Then I want the String from this point on, excluding the "post code
    String" containing only numbers, whitespace and dots.
    The class String seems to have a "split(regex) function, but this
    didn't work for me.

    Any idea how this could be done?

    Thanks in advance,
    Christine Mayer, Sep 6, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.