Regex Builder
ForgeForm's Regex Builder provides a robust and convenient way to handle regex-based validation. It comes with a rich library of over 100 pre-built, RCN-compliant regex patterns, covering a wide range of common use cases.
Key Features
- Extensive Pre-built Patterns: Over 100 regular expressions readily available for various validation needs.
- RCN Compliance: Patterns adhere to Relaxed Character Normalization (RCN) standards, ensuring flexibility and accuracy.
- Wide Range of Use Cases: Covers everything from basic data formats to complex identifiers and social media patterns.
Pre-built Regex Patterns
warning
Remember: While these regex validators are helpful, always consider the specific requirements of your application and user base. You may need to adjust or extend these patterns for optimal validation. You can also create completely custom regex patterns and use them with ForgeForm.
Common Data Formats
| Validator Name | Description | Use Cases |
|---|---|---|
email | Validates email addresses (RFC 5322 compliant). | Email registration forms, contact forms, profile updates. |
phone | Validates phone numbers (international format). | Phone number fields in user profiles, contact information. |
url | Validates URLs (HTTP, HTTPS, FTP). | Website fields, profile URLs, links in content. |
uuid | Validates UUIDs (versions 1-5). | Unique identifiers, API keys, database record IDs. |
zip | Validates US ZIP codes (5 or 9 digits) & Indian ZIP codes (6 digits). | Address forms for US and Indian users, shipping address validation. |
indianZipCode6Digit | Validates Indian ZIP codes (strict 6 digits). | Forms specifically requiring 6-digit Indian ZIP codes. |
indianZipCode6DigitFlexible | Validates Indian ZIP codes (6 digits, allows spaces/hyphens). | More flexible input for Indian ZIP codes, accommodating common separators. |
ip | Validates IPv4 addresses. | Server address inputs, network configurations. |
date | Validates dates in YYYY-MM-DD format. | Date of birth, event dates, booking dates. |
time | Validates times in HH:MM or HH:MM:SS format. | Appointment times, scheduling forms. |
creditCard | Validates common credit card number formats. | Payment forms (use with caution, consider PCI compliance for real transactions). |
hexColor | Validates hexadecimal color codes. | Color picker inputs, theme customization forms. |
rgb | Validates rgb(r, g, b) color format. | Color settings, visual customization. |
aadhar | Validates Indian Aadhar card numbers (12 digits). | Forms requiring Indian national ID verification (within India, respecting privacy regulations). |
panCard | Validates Indian PAN card numbers. | Financial forms, Indian tax compliance forms. |
indianDrivingLicense | Validates Indian driving license numbers (basic format). | Indian address verification, KYC forms. |
gstNumber | Validates Indian GST numbers. | Indian business forms, tax related forms. |
indianPassport | Validates Indian passport numbers (basic format). | Indian identity verification, travel related forms. |
String Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
alphanumeric | Only letters and numbers. | Usernames, IDs, codes. |
alpha | Only letters. | Names, locations (where only alphabetic input is expected). |
decimal | Decimal numbers (optional sign, decimal point). | Price inputs, measurements, quantities. |
base64 | Base64 encoded strings. | Data encoding validation, API data inputs. |
lowercase | Only lowercase letters. | Enforcing lowercase input for specific fields. |
uppercase | Only uppercase letters. | Enforcing uppercase input like initials or acronyms. |
strongPassword | Strong password criteria (length, case, numbers, special chars). | Password creation/reset forms for security. |
mediumPassword | Medium password criteria (length, case, numbers). | Password suggestions with moderate security. |
weakPassword | Weak password criteria (minimum length only). | Less critical password fields, or for testing purposes only. |
username | Usernames (alphanumeric, underscore, hyphen). | Account creation, profile usernames. |
hashtag | Hashtags (starts with #, alphanumeric, underscore). | Social media content input, tagging features. |
creditCardExpiry | Credit card expiry date (MM/YY or MM/YYYY). | Payment forms. |
cvv | CVV/CVC codes (3 or 4 digits). | Payment forms. |
ssn | US Social Security Numbers (basic format). | Sensitive data forms (use with extreme caution and security best practices). |
canadianPostalCode | Canadian postal codes. | Address forms for Canadian users. |
ukPostcode | UK postcodes. | Address forms for UK users. |
ipAddress | IPv4 or IPv6 addresses. | Network configuration, server settings. |
macAddress | MAC addresses. | Network device identification, hardware settings. |
jwt | JSON Web Tokens (basic structure). | API authentication, token validation (structural). |
semver | Semantic Versioning strings. | Software version input, package management forms. |
vin | Vehicle Identification Number (VIN). | Vehicle registration forms, automotive data input. |
usCurrency | US currency format. | Financial applications, e-commerce platforms. |
signedPercentage | Percentages with optional +/- sign. | Financial reports, performance metrics. |
visaCard | Visa credit card numbers. | Payment forms, specific card type validation. |
masterCard | MasterCard credit card numbers. | Payment forms, specific card type validation. |
amexCard | American Express credit card numbers. | Payment forms, specific card type validation. |
discoverCard | Discover credit card numbers. | Payment forms, specific card type validation. |
dinersClubCard | Diners Club credit card numbers. | Payment forms, specific card type validation. |
jcbCard | JCB credit card numbers. | Payment forms, specific card type validation. |
genericPhoneNumber | Generic phone numbers with extensions. | Flexible phone number input fields. |
ssnFlexible | US Social Security Numbers (flexible formats). | More lenient SSN input, data cleaning. |
usPhoneNumber | US phone numbers with area code format. | US-specific phone number fields. |
time12h | Time in 12-hour format (with AM/PM). | User-friendly time input, appointment scheduling. |
simpleURL | Simple URLs without protocol (domain.tld). | Quick URL input, less strict URL validation. |
youtubeURL | YouTube video URLs. | Embedding videos, content curation. |
vimeoURL | Vimeo video URLs. | Embedding videos, content curation. |
dateSlashMDY | Dates in MM/DD/YYYY format. | US-style date input. |
dateDotDMY | Dates in DD.MM.YYYY format. | European-style date input. |
timeFlexibleMilliseconds | Time with milliseconds (flexible). | Time logging, detailed time input. |
versionNumber | Flexible version numbers. | Software version management, application settings. |
orderId | Order ID format (example). | E-commerce, order tracking systems. |
productCode | Product code format (example). | Inventory systems, product databases. |
trackingNumber | Tracking number format (generic). | Shipping and logistics forms. |
invoiceNumber | Invoice number format (example). | Accounting, billing systems. |
eventId | Event ID format (example). | Event management systems, ticketing. |
jobId | Job ID format (example). | Task management, job tracking applications. |
serialNumber | Serial number format (example). | Equipment tracking, warranty systems. |
modelNumber | Model number format (example). | Product catalogs, technical specifications. |
sku | SKU (Stock Keeping Unit) format (example). | Inventory management, retail systems. |
assetTag | Asset tag format (example). | Asset tracking, inventory management. |
receiptNumber | Receipt number format (example). | Point of sale systems, transaction records. |
confirmationNumber | Confirmation number format (example). | Booking systems, registration confirmations. |
bookingReference | Booking reference format (example). | Travel booking, appointment systems. |
ticketNumber | Ticket number format (example). | Support systems, event ticketing. |
referenceCode | Generic reference code format. | General purpose identification codes. |
voucherCode | Voucher code format (example). | Marketing promotions, discount systems. |
couponCode | Coupon code format (example). | E-commerce discounts, promotional offers. |
promotionCode | Promotion code format (example). | Marketing campaigns, promotional discounts. |
discountCode | Discount code format (example). | E-commerce, sales applications. |
accessCode | Generic access code format. | Security access, authentication systems. |
pinCode | PIN code format (generic 4-8 digits). | Security verification, access control. |
otpCode | OTP (One-Time Password) format (generic 6 digits). | Two-factor authentication, secure transactions. |
verificationCode | Verification code format (generic 6-8 alphanumeric). | Account verification, security processes. |
accountNumber | Account number format (generic). | Financial applications, banking systems. |
iban | IBAN (International Bank Account Number). | International banking, financial transactions. |
swiftCode | SWIFT/BIC code. | International banking, банковские transfers. |
taxId | Tax ID format (generic). | Financial forms, tax compliance. |
registrationNumber | Registration number format (generic). | Business registration, legal documents. |
membershipId | Membership ID format (generic). | Membership management systems, loyalty programs. |
referenceNumber | Reference number format (generic). | General purpose tracking and identification. |
applicationId | Application ID format (generic). | Application tracking, system logs. |
confirmationCode | Confirmation code format (generic). | Transaction confirmations, system responses. |
authorizationCode | Authorization code format (generic). | Payment processing, security authorizations. |
transactionId | Transaction ID format (generic). | E-commerce, financial transaction tracking. |
paymentReference | Payment reference format (generic). | Billing systems, payment tracking. |
bookingNumber | Booking number format (generic). | Reservation systems, appointment booking. |
enrollmentKey | Enrollment key format (generic). | System enrollment, device provisioning. |
activationCode | Activation code format (generic). | Software activation, product licensing. |
unlockCode | Unlock code format (generic). | Device unlocking, access recovery. |
accessKey | Access key format (generic). | API access, secure system entry. |
secretKey | Secret key format (generic). | API keys, security credentials. |
Number Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
integer | Whole numbers (no decimals). | Age, quantity, counts, whole number inputs. |
positiveInteger | Positive integers (greater than zero). | Order quantities, counts (where zero is invalid). |
negativeInteger | Negative integers (less than zero). | Representing debts, negative balances (less common in forms). |
nonNegativeInteger | Zero or positive integers. | Counts, quantities (allowing zero). |
nonPositiveInteger | Zero or negative integers. | (Less common use case, possibly for specific financial inputs). |
float | Floating-point numbers (with decimals). | Prices, measurements with decimal precision. |
positiveFloat | Positive floating-point numbers. | Positive measurements, amounts. |
negativeFloat | Negative floating-point numbers. | (Less common use case, could be for financial losses/negative changes). |
percentage | Percentages (0-100%). | Discount rates, progress indicators. |
port | Port numbers (0-65535). | Network settings, server configurations. |
year | Years in YYYY format. | Year selection in date pickers, historical data input. |
month | Months in MM format (01-12). | Month selection, date parts input. |
day | Days in DD format (01-31). | Day selection, date parts input. |
hour | Hours in HH format (00-23). | Time selection, scheduling. |
minute | Minutes in MM format (00-59). | Time selection, duration input. |
second | Seconds in SS format (00-59). | Precise time input, durations. |
Text/String Content Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
words | Letters, spaces, hyphens, apostrophes (for words). | Name fields, descriptions, text inputs where sentences are expected. |
sentence | Basic sentence structure (starts uppercase, ends with punctuation). | Paragraphs, descriptions that should resemble sentences. |
paragraph | Multiple sentences. | Long text descriptions, articles, comment sections. |
creditCardNumber | Credit card numbers (digits, spaces, hyphens). | Payment forms (again, PCI compliance for real transactions is crucial). |
alphaSpace | Letters and spaces only. | Full name input (if only letters and spaces are allowed). |
alphanumericSpace | Letters, numbers, and spaces. | Addresses, descriptions that can contain numbers and letters. |
filename | Filenames (alphanumeric, underscore, hyphen, period). | File upload forms, document naming conventions. |
fileExtension | File extensions (alphanumeric, 2-4 chars). | File type validation in upload forms. |
Location/Geographic Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
latitude | Latitude coordinates (-90 to +90 degrees). | Location data input, mapping applications. |
longitude | Longitude coordinates (-180 to +180 degrees). | Location data input, mapping applications. |
postalCode | Generic alphanumeric postal codes. | Address forms (for countries not specifically covered). |
countryCode | 2-letter uppercase ISO country codes. | Country selection, address forms. |
currencySymbol | Common currency symbols ($, €, £, ¥, ₹). | Currency input, financial forms, now includes Indian Rupee. |
Social Media/Online Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
twitterHandle | Twitter handles (starts with @, alphanumeric, underscores). | Social media profile links, user mentions. |
instagramUsername | Instagram usernames (alphanumeric, underscore, period). | Social media profile links. |
githubUsername | GitHub usernames (alphanumeric and hyphen). | Developer profiles, project links. |
domainName | Basic domain names. | Website input, URL validation (for basic domain format). |
Semantic/Contextual Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
ean13 | EAN-13 barcodes (13 digits). | Product forms, inventory management (EAN-13 codes). |
isbn10 | ISBN-10 numbers (with or without hyphens). | Book information forms, library systems. |
isbn13 | ISBN-13 numbers (with or without hyphens). | Book information forms, library systems. |
timezoneOffset | Timezone offsets (e.g., +02:00, -05:30, Z). | Scheduling applications, international time settings. |
mimeType | Basic MIME types (type/subtype). | File upload forms, content type validation. |
languageCode | ISO 639-1 2-letter language codes. | Language selection in forms, localization settings. |
countryLanguageCode | Combined country and language codes (e.g., en-US). | Localization settings, regional preferences. |
Empty/Whitespace Patterns
| Validator Name | Description | Use Cases |
|---|---|---|
notEmpty | Non-empty strings (at least one non-whitespace char). | Ensuring required text fields are not just whitespace. |
whitespace | Strings containing only whitespace. | Detecting empty fields (can be used to check if a field is whitespace). |
guid | GUIDs (Globally Unique Identifiers). | Unique IDs, system identifiers. |
socialSecurityNumber | US Social Security Numbers (flexible format). | Sensitive data (use with extreme caution and security). |
yearMonth | Year-Month format (YYYY-MM). | Date ranges, reporting periods. |
monthDay | Month-Day format (MM-DD). | Recurring events, date templates. |
timeMilliseconds | Time with milliseconds (HH:MM:SS.mmm). | Precise time logging, performance measurements. |