Use VBA in Excel to test the following (matching formula: ^ ((?! 2950).) * $ ):
Sub Regs ()
Dim RegEx As Object
Set RegEx = CreateObject ("VBScript. regexp ")
Dim s, mat
S = "399295078"
RegEx. Pattern = "^ ((?! 2950).) * $"
RegEx. Global = True
MsgBox RegEx. test (s)
Set RegEx = Nothing
End Sub
If 2950 is matched, false is returned; otherwise, true is returned.
Where ,(?! 2950) does not match 2950,
^ Indicates the starting position of the matching string,
. Match any single character except "\ n,
$ Indicates the end position of the matched string,
* Indicates matching the previous subexpression zero or multiple times.
The entire matching formula is: match a null value or match a string without 2950.
Where (?! 2950) must be followed by a ".", then (?! 2950). It does not contain 2950 characters and must contain at least one character. In fact, the whole is (?! 2950) and (.) *, (.) * indicates an empty string or any other string (excluding \ n ).