コード例 #1
0
ファイル: FwFindReplaceDlg.cs プロジェクト: sillsdev/WorldPad
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Verifies the pattern is valid. If user wants to use a regex, this validates the
		/// regular expression.
		/// </summary>
		/// <returns><c>true</c> if regular expression is valid or if we don't use regular
		/// expressions, <c>false</c> if regEx is invalid.</returns>
		/// ------------------------------------------------------------------------------------
		private bool PatternIsValid()
		{
			if (chkUseRegularExpressions.Checked)
			{
				IMatcher testMatcher = new RegExpMatcher(m_vwPattern);
				if (!testMatcher.IsValid())
				{
					DisplayInvalidRegExMessage(testMatcher.ErrorMessage());
					return false;
				}
			}
			return true;
		}
コード例 #2
0
		private IMatcher GetRegExpMatcher(int ws)
		{
			SetupSearchPattern(ws);
			IMatcher matcher = new RegExpMatcher(m_vwPattern);
			if (!matcher.IsValid())
			{
				ShowRegExpMatcherError(matcher);
			}
			return matcher;
		}