Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

.NET Regular Expressions Find and Replace Add-In for Visual Studio 2008

, 12 Oct 2009 CPOL
A .NET Regular Expressions Find and Replace add-in for Visual Studio 2008
using System;

namespace RegexFindAndReplace
{
    public class FirstFindFailedAndSecondSucceededState : IFindState
    {
        /// <summary>
        /// Finds the next match.
        /// </summary>
        /// <param name="finderAndReplacer">The FinderAndReplacer.</param>
        public void FindNext( FinderAndReplacer finderAndReplacer )
        {
            if ( finderAndReplacer.AttemptMatch() )
            {
                finderAndReplacer.SelectMatchedText();
            }
            else
            {
                finderAndReplacer.ResetLatestFindStartPosition();
                finderAndReplacer.SetState( new FirstFindState() );
                finderAndReplacer.ShowMessage( "Passed the end of the document.", true );
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

jhillman
Software Developer
United States United States
I am a software developer currently working in Salt Lake City, Utah. I work primarily with C# for my job, but I mess around with C, Perl, and Windows PowerShell for fun.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 12 Oct 2009
Article Copyright 2008 by jhillman
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid