tools/Stampfer/PeterSource1_1/Forms/Find.cs
/// <summary>
/// Gets the Regular Expression to search for...
/// </summary>
/// <returns>RegEx</returns>
Gets the Regular Expression to search for
Gets the Regular Expression to search for
public Regex GetRegEx()
        {
            string regExString = this.cmbFindText.Text;
            if (this.ckbUseRegEx.Checked)
            {
            }
            else if (this.ckbWildCard.Checked)
            {
                regExString = regExString.Replace("*", @"\w*");
                regExString = regExString.Replace("?", @"\w");
                regExString = String.Format("{0}{1}{0}", @"\b", regExString);
            }
            else
            {
                regExString = Regex.Escape(regExString);
            }
            if (this.ckbMatchWord.Checked)
            {
                regExString = String.Format("{0}{1}{0}", @"\b", regExString);
            }
            try
            {
                if (this.ckbMatchCase.Checked)
                {
                    return new Regex(regExString);
                }
                else
                {
                    return new Regex(regExString, RegexOptions.IgnoreCase);
                }
            }
            catch
            {
                return null;
            }
        }
public Regex GetRegEx ( ) { string regExString = this . cmbFindText . Text ; if ( this . ckbUseRegEx . Checked ) { } else if ( this . ckbWildCard . Checked ) { regExString = regExString . Replace ( " " , @"\w*" ) ; regExString = regExString . Replace ( " " , @"\w" ) ; regExString = String . Format ( " " , @"\b" , regExString ) ; } else { regExString = Regex . Escape ( regExString ) ; } if ( this . ckbMatchWord . Checked ) { regExString = String . Format ( " " , @"\b" , regExString ) ; } try { if ( this . ckbMatchCase . Checked ) { return new Regex ( regExString ) ; } else { return new Regex ( regExString , RegexOptions . IgnoreCase ) ; } } catch { return null ; } }
Gets the Regular Expression to search for...
Gets the Regular Expression to search for ...
// We dont need to do anything...
None