Visual Studio Find & Replace Question??

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

    Visual Studio Find & Replace Question??


    VS2005

    In the find/replace dialog if I make a regex like this I can find all
    of the "New" statements that instantiate a class with "System" in the
    name:

    <New>.*<Syste m>

    But how - in the VS find/replace dialog - can I negate the "System"
    portion of the search? How do I say: find all lines with "New" that
    do NOT have the word "System" after "New"??

    Any help would be appreciated...
  • Mythran

    #2
    Re: Visual Studio Find &amp; Replace Question??



    "Crash" <sourcenexus@sa n.rr.comwrote in message
    news:5f34c447-7aae-4f0e-bf7f-86e3c3d5fd1e@d7 7g2000hsb.googl egroups.com...
    >
    VS2005
    >
    In the find/replace dialog if I make a regex like this I can find all
    of the "New" statements that instantiate a class with "System" in the
    name:
    >
    <New>.*<Syste m>
    >
    But how - in the VS find/replace dialog - can I negate the "System"
    portion of the search? How do I say: find all lines with "New" that
    do NOT have the word "System" after "New"??
    >
    Any help would be appreciated...
    Try the following:

    <New>:b+<~(Syst em).*>

    I replaced your .* between Newand <System so it only matches whitespace
    (tabs and/or spaces) in between.....cha nge it back if that's not what you
    want :)

    HTH,
    Mythran


    Comment

    • Mr. Arnold

      #3
      Re: Visual Studio Find &amp; Replace Question??


      "Crash" <sourcenexus@sa n.rr.comwrote in message
      news:5f34c447-7aae-4f0e-bf7f-86e3c3d5fd1e@d7 7g2000hsb.googl egroups.com...
      >
      VS2005
      >
      In the find/replace dialog if I make a regex like this I can find all
      of the "New" statements that instantiate a class with "System" in the
      name:
      >
      <New>.*<Syste m>
      >
      But how - in the VS find/replace dialog - can I negate the "System"
      portion of the search? How do I say: find all lines with "New" that
      do NOT have the word "System" after "New"??
      >
      Any help would be appreciated...
      You can write a solution that does this as an add in to the VS IDE. When you
      publish it, let me know.

      It had better work. <smile>

      Comment

      • Mythran

        #4
        Re: Visual Studio Find &amp; Replace Question??



        "Mythran" <Mythran@commun ity.nospamwrote in message
        news:168EF1F6-2F3D-45A7-BBBF-EEA989735CFA@mi crosoft.com...
        >
        >
        "Crash" <sourcenexus@sa n.rr.comwrote in message
        news:5f34c447-7aae-4f0e-bf7f-86e3c3d5fd1e@d7 7g2000hsb.googl egroups.com...
        >>
        >VS2005
        >>
        >In the find/replace dialog if I make a regex like this I can find all
        >of the "New" statements that instantiate a class with "System" in the
        >name:
        >>
        ><New>.*<System >
        >>
        >But how - in the VS find/replace dialog - can I negate the "System"
        >portion of the search? How do I say: find all lines with "New" that
        >do NOT have the word "System" after "New"??
        >>
        >Any help would be appreciated...
        >
        Try the following:
        >
        <New>:b+<~(Syst em).*>
        >
        I replaced your .* between Newand <System so it only matches whitespace
        (tabs and/or spaces) in between.....cha nge it back if that's not what you
        want :)
        >
        HTH,
        Mythran
        >
        >
        You can also replace the (System).* with (System).@ to get only the word
        portion and not the entire string (IE:

        Dim I As New IO.Stream

        The first post I made would capture "New IO.Stream" while the new way I
        posted would capture "New IO"

        HTH,
        Mythran


        Comment

        Working...