Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 603 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 603 Bytes

Delphi implementation of VerbalExpression

This is a implementation of VerbalExpression for Delphi.

Example

var
  LobjVerbalExpression : TVerbalExpression;
begin
  LobjVerbalExpression := TVerbalExpression.Create
    .StartOfLine()
    .Then('http')
    .Maybe('s')
    .Then('://')
    .Maybe('www.')
    .anythingBut(' ')
    .endOfLine();

  ListBox1.Items.Add(LobjVerbalExpression.AsString);

  if LobjVerbalExpression.Test('https://github.com') then
    ListBox1.Items.Add('valid url')
  else
    ListBox1.Items.Add('invalid url');

end;