Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

DelphiVerbalExpressions

A verbal expression implementation in Delphi

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Delphi implementation of VerbalExpression

This is a implementation of VerbalExpression for Delphi.

Example

delphi
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;