@@ -456,6 +456,7 @@ private void OnCompareTypeChanged()
456456 case ScanValueType . Double :
457457 case ScanValueType . ArrayOfBytes :
458458 case ScanValueType . String :
459+ case ScanValueType . Regex :
459460 isHexCheckBox . Checked = false ;
460461 enableHexCheckBox = false ;
461462 break ;
@@ -487,6 +488,7 @@ private void OnValueTypeChanged()
487488 case ScanValueType . Double :
488489 case ScanValueType . ArrayOfBytes :
489490 case ScanValueType . String :
491+ case ScanValueType . Regex :
490492 isHexCheckBox . Checked = false ;
491493 isHexCheckBox . Enabled = false ;
492494 break ;
@@ -508,7 +510,7 @@ private void OnValueTypeChanged()
508510 fastScanAlignmentTextBox . Text = alignment . ToString ( ) ;
509511
510512 floatingOptionsGroupBox . Visible = valueType == ScanValueType . Float || valueType == ScanValueType . Double ;
511- stringOptionsGroupBox . Visible = valueType == ScanValueType . String ;
513+ stringOptionsGroupBox . Visible = valueType == ScanValueType . String || valueType == ScanValueType . Regex ;
512514 }
513515
514516 /// <summary>
@@ -518,7 +520,7 @@ private void SetValidCompareTypes()
518520 {
519521 var compareType = compareTypeComboBox . SelectedValue ;
520522 var valueType = valueTypeComboBox . SelectedValue ;
521- if ( valueType == ScanValueType . ArrayOfBytes || valueType == ScanValueType . String )
523+ if ( valueType == ScanValueType . ArrayOfBytes || valueType == ScanValueType . String || valueType == ScanValueType . Regex )
522524 {
523525 compareTypeComboBox . SetAvailableValues ( ScanCompareType . Equal ) ;
524526 }
@@ -814,16 +816,22 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat)
814816
815817 return new ArrayOfBytesMemoryComparer ( pattern ) ;
816818 }
817- else if ( settings . ValueType == ScanValueType . String )
819+ else if ( settings . ValueType == ScanValueType . String || settings . ValueType == ScanValueType . Regex )
818820 {
819821 if ( string . IsNullOrEmpty ( dualValueBox . Value1 ) )
820822 {
821823 throw new InvalidInputException ( dualValueBox . Value1 ) ;
822824 }
823825
824826 var encoding = encodingUtf8RadioButton . Checked ? Encoding . UTF8 : encodingUtf16RadioButton . Checked ? Encoding . Unicode : Encoding . UTF32 ;
825-
826- return new StringMemoryComparer ( dualValueBox . Value1 , encoding , caseSensitiveCheckBox . Checked ) ;
827+ if ( settings . ValueType == ScanValueType . String )
828+ {
829+ return new StringMemoryComparer ( dualValueBox . Value1 , encoding , caseSensitiveCheckBox . Checked ) ;
830+ }
831+ else
832+ {
833+ return new RegexStringMemoryComparer ( dualValueBox . Value1 , encoding , caseSensitiveCheckBox . Checked ) ;
834+ }
827835 }
828836
829837 throw new InvalidOperationException ( ) ;
@@ -858,6 +866,7 @@ private static void FindWhatInteractsWithSelectedRecord(MemoryRecord record, boo
858866 size = record . ValueLength ;
859867 break ;
860868 case ScanValueType . String :
869+ case ScanValueType . Regex :
861870 size = record . ValueLength ;
862871 break ;
863872 default :
0 commit comments