regex?

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

    #1

    regex?

    Hi,

    having 2 strings i need to find out if the last letters of the first string
    are the first letters of the second one. I can program this easily with
    strings by talking larger or smaller groups of letters of both words and
    comparing them. Now I was wondering if this somehow was possible with
    regular expressions. If so, I think they would make my code a bit easier but
    I have no clue where to start with a regex for such a thing. Any ideas?

    tia

    Yves


  • Dino Chiesa [Microsoft]

    #2
    Re: regex?

    May I suggest you try to Read The Friendly Manual?

    http://msdn.microsoft.com/library/en...xpressions.asp

    This section of the doc includes some examples that may show you if and how
    Regex would apply to your situation.

    -Dino

    --
    Dino Chiesa
    Microsoft Developer Division
    d i n o c h @ o n l i n e . m i c r o s o f t . c o m

    "phoenix" <patient0@skyne tWORK.be> wrote in message
    news:%23x1Df3Nn DHA.2848@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > Hi,
    >
    > having 2 strings i need to find out if the last letters of the first[/color]
    string[color=blue]
    > are the first letters of the second one. I can program this easily with
    > strings by talking larger or smaller groups of letters of both words and
    > comparing them. Now I was wondering if this somehow was possible with
    > regular expressions. If so, I think they would make my code a bit easier[/color]
    but[color=blue]
    > I have no clue where to start with a regex for such a thing. Any ideas?
    >
    > tia
    >
    > Yves
    >
    >[/color]


    Comment

    • phoenix

      #3
      Re: regex?

      I RTFM.

      The problem is I can't find anything about partial matching. I assumed it
      was implemented in .Net but now I begin to think it isn't. In case it was
      not clear what I meant, I was talking about the functionality which is
      implemented in packages like Boost
      (http://www.boost.org/libs/regex/temp...artial_matches)

      Yves



      "Dino Chiesa [Microsoft]" <dinoch@online. microsoft.com> schreef in bericht
      news:es3GMJOnDH A.2272@tk2msftn gp13.phx.gbl...[color=blue]
      > May I suggest you try to Read The Friendly Manual?
      >
      >[/color]
      http://msdn.microsoft.com/library/en...egularexpressi
      ons.asp[color=blue]
      >
      > This section of the doc includes some examples that may show you if and[/color]
      how[color=blue]
      > Regex would apply to your situation.
      >
      > -Dino
      >
      > --
      > Dino Chiesa
      > Microsoft Developer Division
      > d i n o c h @ o n l i n e . m i c r o s o f t . c o m
      >
      > "phoenix" <patient0@skyne tWORK.be> wrote in message
      > news:%23x1Df3Nn DHA.2848@TK2MSF TNGP10.phx.gbl. ..[color=green]
      > > Hi,
      > >
      > > having 2 strings i need to find out if the last letters of the first[/color]
      > string[color=green]
      > > are the first letters of the second one. I can program this easily with
      > > strings by talking larger or smaller groups of letters of both words and
      > > comparing them. Now I was wondering if this somehow was possible with
      > > regular expressions. If so, I think they would make my code a bit easier[/color]
      > but[color=green]
      > > I have no clue where to start with a regex for such a thing. Any ideas?
      > >
      > > tia
      > >
      > > Yves
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Dino Chiesa [Microsoft]

        #4
        Re: regex?


        Ahh, pardon me.

        I don't recall anything about partial matching. The behavior and capability
        of the .NET Regex engine is well documented at
        http://msdn.microsoft.com/library/en...onbehavior.asp



        "phoenix" <patient0@skyne tWORK.be> wrote in message
        news:uXV4W5TnDH A.2488@TK2MSFTN GP12.phx.gbl...[color=blue]
        > I RTFM.
        >
        > The problem is I can't find anything about partial matching. I assumed it
        > was implemented in .Net but now I begin to think it isn't. In case it was
        > not clear what I meant, I was talking about the functionality which is
        > implemented in packages like Boost
        > (http://www.boost.org/libs/regex/temp...artial_matches)
        >
        > Yves
        >
        >
        >
        > "Dino Chiesa [Microsoft]" <dinoch@online. microsoft.com> schreef in bericht
        > news:es3GMJOnDH A.2272@tk2msftn gp13.phx.gbl...[color=green]
        > > May I suggest you try to Read The Friendly Manual?
        > >
        > >[/color]
        >[/color]
        http://msdn.microsoft.com/library/en...egularexpressi[color=blue]
        > ons.asp[color=green]
        > >
        > > This section of the doc includes some examples that may show you if and[/color]
        > how[color=green]
        > > Regex would apply to your situation.
        > >
        > > -Dino
        > >
        > > --
        > > Dino Chiesa
        > > Microsoft Developer Division
        > > d i n o c h @ o n l i n e . m i c r o s o f t . c o m
        > >
        > > "phoenix" <patient0@skyne tWORK.be> wrote in message
        > > news:%23x1Df3Nn DHA.2848@TK2MSF TNGP10.phx.gbl. ..[color=darkred]
        > > > Hi,
        > > >
        > > > having 2 strings i need to find out if the last letters of the first[/color]
        > > string[color=darkred]
        > > > are the first letters of the second one. I can program this easily[/color][/color][/color]
        with[color=blue][color=green][color=darkred]
        > > > strings by talking larger or smaller groups of letters of both words[/color][/color][/color]
        and[color=blue][color=green][color=darkred]
        > > > comparing them. Now I was wondering if this somehow was possible with
        > > > regular expressions. If so, I think they would make my code a bit[/color][/color][/color]
        easier[color=blue][color=green]
        > > but[color=darkred]
        > > > I have no clue where to start with a regex for such a thing. Any[/color][/color][/color]
        ideas?[color=blue][color=green][color=darkred]
        > > >
        > > > tia
        > > >
        > > > Yves
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...