string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • powerranger

    #1

    string

    I have a string like "abc hello world abc ri3eroefjdfjdfj dkffkfdjf".
    If I want to use Regular Expression to split/extract whatever is
    between abc, how I can do this? Please help! Thanks.
  • James J. Foster

    #2
    Re: string

    One option is to use capturing groups to pull out the section, using a
    regular expression like so:

    abc(.*)abc

    The parens will create a group that you can later extract explicitly. See
    here for code on using Matches and Groups
    http://www.dotnetcoders.com/web/Lear...ex/groups.aspx . Note in this
    case, the regex parser will be greedy if multiple abc's are present.


    James J. Foster, DotNetCoders




    "powerrange r" <tangolp@yahoo. com> wrote in message
    news:13bc95e0.0 306260932.19406 582@posting.goo gle.com...[color=blue]
    > I have a string like "abc hello world abc ri3eroefjdfjdfj dkffkfdjf".
    > If I want to use Regular Expression to split/extract whatever is
    > between abc, how I can do this? Please help! Thanks.[/color]


    Comment

    Working...