pai System & Utilities
validation
Input validation library for PascalAI. Validate emails, URLs, IP addresses, phone numbers, and common data formats.
Install ppm install validation
Usage Example
uses validation; // Validate user input var email := 'user@example.com'; if not IsEmail(email) then raise 'Invalid email address'; var url := 'https://pascalai.org'; if not IsURL(url) then raise 'Invalid URL'; // Type checks var ok1 := IsAlpha('HelloWorld'); // True var ok2 := IsNumeric('12345'); // True var ok3 := IsIP('192.168.1.1'); // True // Length constraints var pw := 'mypass'; if not MinLen(pw, 8) then raise 'Password too short'; // Date validation var ok4 := IsDate('2026-03-12', 'YYYY-MM-DD'); // True
Features
IsEmail: RFC 5322-compliant email validation
IsURL: validate HTTP/HTTPS URLs
IsIP: validate IPv4 and IPv6 addresses
IsPhone: international phone number validation
IsAlpha, IsNumeric, IsAlphanumeric: character set checks
IsDate: date string validation with format
MinLen, MaxLen: length constraint checks
← Back to Package Index