形式
Delphi
投稿日時
2019-07-18 04:24
公開期間
無期限
  1. function RegExMatch(ASubject, APattern: String; AGroup: Byte; AMatchCount: ShortInt; AOverrideOptions: Boolean; AOptions: TPerlRegExOptions; out AMatch: String; ASeparator: String = ';'): Boolean;
  2. begin
  3. Result := False;
  4. AMatch := '';
  5. with TPerlRegEx.Create do
  6. try
  7. Subject := ASubject;
  8. RegEx := APattern;
  9. if AOverrideOptions then
  10. Options := AOptions;
  11. if Match then
  12. begin
  13. Result := True;
  14. if AMatchCount = 0 then
  15. AMatchCount := -1;
  16. if AGroup > 0 then
  17. repeat
  18. if AMatch = '' then
  19. AMatch := Groups[AGroup]
  20. else
  21. AMatch := AMatch + ASeparator + Groups[AGroup];
  22. Dec(AMatchCount);
  23. until (AMatchCount = 0) or (not MatchAgain)
  24. else
  25. repeat
  26. if AMatch = '' then
  27. AMatch := MatchedText
  28. else
  29. AMatch := AMatch + ASeparator + MatchedText;
  30. Dec(AMatchCount);
  31. until (AMatchCount = 0) or (not MatchAgain)
  32. end;
  33. finally
  34. Free;
  35. end;
  36. end;
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト