Help to write a regular expression

  • Hi,

    I need write a regular expression:

    1. Must start in caracter - next to any letter.

    2. Must end in caracter - next to any number.

    For example:

    5D-Canada-Alberta-Calgary-5715-#3#3-9990516-V3-Local-8-0-0

    My output is:

    Canada-Alberta-Calgary

    Thanks.....

  • What have you tried so far?

    It is unlikely that you will be assisted here if your question seems like homework and your post doesn't follow the recommended criteria.

  • Helical Johan (11/26/2010)


    Hi,

    I need write a regular expression:

    1. Must start in caracter - next to any letter.

    2. Must end in caracter - next to any number.

    For example:

    5D-Canada-Alberta-Calgary-5715-#3#3-9990516-V3-Local-8-0-0

    My output is:

    Canada-Alberta-Calgary

    Thanks.....

    Will the dashes always be present as you've portrayed?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply