locked
Split a string matching the following pattern RRS feed

  • Question

  • Hi,

     

    I would like to match a string that starts with RFF+ folllowed by 2 or 3 characters and followed by colon(:).

    For instance accepted values are :

     

    RFF+AUN:

    RFF+MO:

    RFF+NAS:

    ...

     

    Thanks

     

     

     




    Wednesday, March 30, 2011 8:08 AM

Answers

  • Ok I managed to match something with the following pattern :

    @"RFF\+\w{3}:"

    but now the question is how can I specify 2 or 3 \w ?

    OR maybe I could make a OR operator but not sure how to do it with regexp ...

    @"RFF\+\w{2,3}:"

    min 2 times

    max 3 times


    "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination." - Fred Brooks
    • Proposed as answer by WolfgangKluge Wednesday, March 30, 2011 10:28 AM
    • Marked as answer by Shifusan Wednesday, March 30, 2011 1:46 PM
    Wednesday, March 30, 2011 10:23 AM

All replies

  • Ok I managed to match something with the following pattern :

    @"RFF\+\w{3}:"

    but now the question is how can I specify 2 or 3 \w ?

    OR maybe I could make a OR operator but not sure how to do it with regexp ...

    Wednesday, March 30, 2011 9:48 AM
  • Ok I managed to match something with the following pattern :

    @"RFF\+\w{3}:"

    but now the question is how can I specify 2 or 3 \w ?

    OR maybe I could make a OR operator but not sure how to do it with regexp ...

    @"RFF\+\w{2,3}:"

    min 2 times

    max 3 times


    "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination." - Fred Brooks
    • Proposed as answer by WolfgangKluge Wednesday, March 30, 2011 10:28 AM
    • Marked as answer by Shifusan Wednesday, March 30, 2011 1:46 PM
    Wednesday, March 30, 2011 10:23 AM