ForgeForm

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 NameDescriptionUse Cases
emailValidates email addresses (RFC 5322 compliant).Email registration forms, contact forms, profile updates.
phoneValidates phone numbers (international format).Phone number fields in user profiles, contact information.
urlValidates URLs (HTTP, HTTPS, FTP).Website fields, profile URLs, links in content.
uuidValidates UUIDs (versions 1-5).Unique identifiers, API keys, database record IDs.
zipValidates US ZIP codes (5 or 9 digits) & Indian ZIP codes (6 digits).Address forms for US and Indian users, shipping address validation.
indianZipCode6DigitValidates Indian ZIP codes (strict 6 digits).Forms specifically requiring 6-digit Indian ZIP codes.
indianZipCode6DigitFlexibleValidates Indian ZIP codes (6 digits, allows spaces/hyphens).More flexible input for Indian ZIP codes, accommodating common separators.
ipValidates IPv4 addresses.Server address inputs, network configurations.
dateValidates dates in YYYY-MM-DD format.Date of birth, event dates, booking dates.
timeValidates times in HH:MM or HH:MM:SS format.Appointment times, scheduling forms.
creditCardValidates common credit card number formats.Payment forms (use with caution, consider PCI compliance for real transactions).
hexColorValidates hexadecimal color codes.Color picker inputs, theme customization forms.
rgbValidates rgb(r, g, b) color format.Color settings, visual customization.
aadharValidates Indian Aadhar card numbers (12 digits).Forms requiring Indian national ID verification (within India, respecting privacy regulations).
panCardValidates Indian PAN card numbers.Financial forms, Indian tax compliance forms.
indianDrivingLicenseValidates Indian driving license numbers (basic format).Indian address verification, KYC forms.
gstNumberValidates Indian GST numbers.Indian business forms, tax related forms.
indianPassportValidates Indian passport numbers (basic format).Indian identity verification, travel related forms.

String Patterns

Validator NameDescriptionUse Cases
alphanumericOnly letters and numbers.Usernames, IDs, codes.
alphaOnly letters.Names, locations (where only alphabetic input is expected).
decimalDecimal numbers (optional sign, decimal point).Price inputs, measurements, quantities.
base64Base64 encoded strings.Data encoding validation, API data inputs.
lowercaseOnly lowercase letters.Enforcing lowercase input for specific fields.
uppercaseOnly uppercase letters.Enforcing uppercase input like initials or acronyms.
strongPasswordStrong password criteria (length, case, numbers, special chars).Password creation/reset forms for security.
mediumPasswordMedium password criteria (length, case, numbers).Password suggestions with moderate security.
weakPasswordWeak password criteria (minimum length only).Less critical password fields, or for testing purposes only.
usernameUsernames (alphanumeric, underscore, hyphen).Account creation, profile usernames.
hashtagHashtags (starts with #, alphanumeric, underscore).Social media content input, tagging features.
creditCardExpiryCredit card expiry date (MM/YY or MM/YYYY).Payment forms.
cvvCVV/CVC codes (3 or 4 digits).Payment forms.
ssnUS Social Security Numbers (basic format).Sensitive data forms (use with extreme caution and security best practices).
canadianPostalCodeCanadian postal codes.Address forms for Canadian users.
ukPostcodeUK postcodes.Address forms for UK users.
ipAddressIPv4 or IPv6 addresses.Network configuration, server settings.
macAddressMAC addresses.Network device identification, hardware settings.
jwtJSON Web Tokens (basic structure).API authentication, token validation (structural).
semverSemantic Versioning strings.Software version input, package management forms.
vinVehicle Identification Number (VIN).Vehicle registration forms, automotive data input.
usCurrencyUS currency format.Financial applications, e-commerce platforms.
signedPercentagePercentages with optional +/- sign.Financial reports, performance metrics.
visaCardVisa credit card numbers.Payment forms, specific card type validation.
masterCardMasterCard credit card numbers.Payment forms, specific card type validation.
amexCardAmerican Express credit card numbers.Payment forms, specific card type validation.
discoverCardDiscover credit card numbers.Payment forms, specific card type validation.
dinersClubCardDiners Club credit card numbers.Payment forms, specific card type validation.
jcbCardJCB credit card numbers.Payment forms, specific card type validation.
genericPhoneNumberGeneric phone numbers with extensions.Flexible phone number input fields.
ssnFlexibleUS Social Security Numbers (flexible formats).More lenient SSN input, data cleaning.
usPhoneNumberUS phone numbers with area code format.US-specific phone number fields.
time12hTime in 12-hour format (with AM/PM).User-friendly time input, appointment scheduling.
simpleURLSimple URLs without protocol (domain.tld).Quick URL input, less strict URL validation.
youtubeURLYouTube video URLs.Embedding videos, content curation.
vimeoURLVimeo video URLs.Embedding videos, content curation.
dateSlashMDYDates in MM/DD/YYYY format.US-style date input.
dateDotDMYDates in DD.MM.YYYY format.European-style date input.
timeFlexibleMillisecondsTime with milliseconds (flexible).Time logging, detailed time input.
versionNumberFlexible version numbers.Software version management, application settings.
orderIdOrder ID format (example).E-commerce, order tracking systems.
productCodeProduct code format (example).Inventory systems, product databases.
trackingNumberTracking number format (generic).Shipping and logistics forms.
invoiceNumberInvoice number format (example).Accounting, billing systems.
eventIdEvent ID format (example).Event management systems, ticketing.
jobIdJob ID format (example).Task management, job tracking applications.
serialNumberSerial number format (example).Equipment tracking, warranty systems.
modelNumberModel number format (example).Product catalogs, technical specifications.
skuSKU (Stock Keeping Unit) format (example).Inventory management, retail systems.
assetTagAsset tag format (example).Asset tracking, inventory management.
receiptNumberReceipt number format (example).Point of sale systems, transaction records.
confirmationNumberConfirmation number format (example).Booking systems, registration confirmations.
bookingReferenceBooking reference format (example).Travel booking, appointment systems.
ticketNumberTicket number format (example).Support systems, event ticketing.
referenceCodeGeneric reference code format.General purpose identification codes.
voucherCodeVoucher code format (example).Marketing promotions, discount systems.
couponCodeCoupon code format (example).E-commerce discounts, promotional offers.
promotionCodePromotion code format (example).Marketing campaigns, promotional discounts.
discountCodeDiscount code format (example).E-commerce, sales applications.
accessCodeGeneric access code format.Security access, authentication systems.
pinCodePIN code format (generic 4-8 digits).Security verification, access control.
otpCodeOTP (One-Time Password) format (generic 6 digits).Two-factor authentication, secure transactions.
verificationCodeVerification code format (generic 6-8 alphanumeric).Account verification, security processes.
accountNumberAccount number format (generic).Financial applications, banking systems.
ibanIBAN (International Bank Account Number).International banking, financial transactions.
swiftCodeSWIFT/BIC code.International banking, банковские transfers.
taxIdTax ID format (generic).Financial forms, tax compliance.
registrationNumberRegistration number format (generic).Business registration, legal documents.
membershipIdMembership ID format (generic).Membership management systems, loyalty programs.
referenceNumberReference number format (generic).General purpose tracking and identification.
applicationIdApplication ID format (generic).Application tracking, system logs.
confirmationCodeConfirmation code format (generic).Transaction confirmations, system responses.
authorizationCodeAuthorization code format (generic).Payment processing, security authorizations.
transactionIdTransaction ID format (generic).E-commerce, financial transaction tracking.
paymentReferencePayment reference format (generic).Billing systems, payment tracking.
bookingNumberBooking number format (generic).Reservation systems, appointment booking.
enrollmentKeyEnrollment key format (generic).System enrollment, device provisioning.
activationCodeActivation code format (generic).Software activation, product licensing.
unlockCodeUnlock code format (generic).Device unlocking, access recovery.
accessKeyAccess key format (generic).API access, secure system entry.
secretKeySecret key format (generic).API keys, security credentials.

Number Patterns

Validator NameDescriptionUse Cases
integerWhole numbers (no decimals).Age, quantity, counts, whole number inputs.
positiveIntegerPositive integers (greater than zero).Order quantities, counts (where zero is invalid).
negativeIntegerNegative integers (less than zero).Representing debts, negative balances (less common in forms).
nonNegativeIntegerZero or positive integers.Counts, quantities (allowing zero).
nonPositiveIntegerZero or negative integers.(Less common use case, possibly for specific financial inputs).
floatFloating-point numbers (with decimals).Prices, measurements with decimal precision.
positiveFloatPositive floating-point numbers.Positive measurements, amounts.
negativeFloatNegative floating-point numbers.(Less common use case, could be for financial losses/negative changes).
percentagePercentages (0-100%).Discount rates, progress indicators.
portPort numbers (0-65535).Network settings, server configurations.
yearYears in YYYY format.Year selection in date pickers, historical data input.
monthMonths in MM format (01-12).Month selection, date parts input.
dayDays in DD format (01-31).Day selection, date parts input.
hourHours in HH format (00-23).Time selection, scheduling.
minuteMinutes in MM format (00-59).Time selection, duration input.
secondSeconds in SS format (00-59).Precise time input, durations.

Text/String Content Patterns

Validator NameDescriptionUse Cases
wordsLetters, spaces, hyphens, apostrophes (for words).Name fields, descriptions, text inputs where sentences are expected.
sentenceBasic sentence structure (starts uppercase, ends with punctuation).Paragraphs, descriptions that should resemble sentences.
paragraphMultiple sentences.Long text descriptions, articles, comment sections.
creditCardNumberCredit card numbers (digits, spaces, hyphens).Payment forms (again, PCI compliance for real transactions is crucial).
alphaSpaceLetters and spaces only.Full name input (if only letters and spaces are allowed).
alphanumericSpaceLetters, numbers, and spaces.Addresses, descriptions that can contain numbers and letters.
filenameFilenames (alphanumeric, underscore, hyphen, period).File upload forms, document naming conventions.
fileExtensionFile extensions (alphanumeric, 2-4 chars).File type validation in upload forms.

Location/Geographic Patterns

Validator NameDescriptionUse Cases
latitudeLatitude coordinates (-90 to +90 degrees).Location data input, mapping applications.
longitudeLongitude coordinates (-180 to +180 degrees).Location data input, mapping applications.
postalCodeGeneric alphanumeric postal codes.Address forms (for countries not specifically covered).
countryCode2-letter uppercase ISO country codes.Country selection, address forms.
currencySymbolCommon currency symbols ($, €, £, ¥, ₹).Currency input, financial forms, now includes Indian Rupee.

Social Media/Online Patterns

Validator NameDescriptionUse Cases
twitterHandleTwitter handles (starts with @, alphanumeric, underscores).Social media profile links, user mentions.
instagramUsernameInstagram usernames (alphanumeric, underscore, period).Social media profile links.
githubUsernameGitHub usernames (alphanumeric and hyphen).Developer profiles, project links.
domainNameBasic domain names.Website input, URL validation (for basic domain format).

Semantic/Contextual Patterns

Validator NameDescriptionUse Cases
ean13EAN-13 barcodes (13 digits).Product forms, inventory management (EAN-13 codes).
isbn10ISBN-10 numbers (with or without hyphens).Book information forms, library systems.
isbn13ISBN-13 numbers (with or without hyphens).Book information forms, library systems.
timezoneOffsetTimezone offsets (e.g., +02:00, -05:30, Z).Scheduling applications, international time settings.
mimeTypeBasic MIME types (type/subtype).File upload forms, content type validation.
languageCodeISO 639-1 2-letter language codes.Language selection in forms, localization settings.
countryLanguageCodeCombined country and language codes (e.g., en-US).Localization settings, regional preferences.

Empty/Whitespace Patterns

Validator NameDescriptionUse Cases
notEmptyNon-empty strings (at least one non-whitespace char).Ensuring required text fields are not just whitespace.
whitespaceStrings containing only whitespace.Detecting empty fields (can be used to check if a field is whitespace).
guidGUIDs (Globally Unique Identifiers).Unique IDs, system identifiers.
socialSecurityNumberUS Social Security Numbers (flexible format).Sensitive data (use with extreme caution and security).
yearMonthYear-Month format (YYYY-MM).Date ranges, reporting periods.
monthDayMonth-Day format (MM-DD).Recurring events, date templates.
timeMillisecondsTime with milliseconds (HH:MM:SS.mmm).Precise time logging, performance measurements.

On this page