OSDN Git Service

正規表現まわりの再修正
[winbottle/winbottle.git] / bottleclient / SearchLog.pas
index 9da69c0..06e9de8 100644 (file)
@@ -204,11 +204,12 @@ begin
 end;
 
 procedure TfrmSearchLog.btnOkClick(Sender: TObject);
+var ErrorMsg,CheckScriptPattern :String;
 begin
   // \8c\8b\89ÊOK\82Å\83E\83B\83\93\83h\83E\82ð\95Â\82\82é
   with Condition do
   begin
-    ScriptPattern := edtScriptPattern.Text;
+    CheckScriptPattern := edtScriptPattern.Text;
     ScriptRegExp  := cbxScriptRegExp.Checked;
     Channel  := cbxChannel.Text;
     Ghost    := cbxGhost.Text;
@@ -216,11 +217,14 @@ begin
     MinAgree := spnMinAgree.Value;
     SearchLogRange := TSearchLogRange(rgpSearchLogRange.ItemIndex);
 
-    if ScriptRegExp and (ScriptPattern <> '') then
+    if ScriptRegExp and (CheckScriptPattern <> '') then
     begin
-      ScriptPattern := SafeRegExp(ScriptPattern);
-      if not CheckRegExp(ScriptPattern) then
+      ErrorMsg := SafeAndCheckRegExp(CheckScriptPattern);
+      if ErrorMsg <> '' then begin
+        ShowMessage('\90³\8bK\95\\8c»\82É\8cë\82è\82ª\82 \82è\82Ü\82·'#13#10 + ErrorMsg);
         Exit;
+      end;
+      ScriptPattern := CheckScriptPattern;
     end;
   end;
   if Condition.IsInvalidCondition then