Git Product home page Git Product logo

regex-patterns's Introduction

Regex Patterns

Common Regex Patterns for Standard Verification

Standard String Matching

ID Pattern Description
IS_ALPHA ^[a-zA-Z]+$ This regular expression will match a string that consists only of letters (uppercase or lowercase).
IS_ALPHANUMERIC ^[a-zA-Z0-9]+$ This regular expression will match a string that consists only of letters (uppercase or lowercase) and digits.
IS_BOOLEAN (true|false) This regular expression will match the string "true" or "false" exactly. It is intended to be used to validate boolean values.
IS_EMAIL ^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$ This regular expression is intended to match an email address. It will match a string that starts with one or more word characters (\w), followed by zero or more instances of a dot or hyphen (.-), followed by zero or more word characters, followed by the at symbol (@), followed by one or more word characters, followed by a dot and two or three word characters.
IS_EMPTY ^$ This regular expression will match an empty string. The caret (^) and dollar sign ($) are used to anchor the pattern to the start and end of the string, respectively.
IS_FALSE false This regular expression will match the string "false" exactly. It is intended to be used to validate boolean values.
IS_HTML ^<([a-z]+)([^<]+)(?:>(.)<\/\1>|\s+\/>)$ This regular expression is intended to match an HTML element. It will match a string that starts with an opening angle bracket (<), followed by one or more lowercase letters ([a-z]+), followed by zero or more characters that are not angle brackets ([^<]+), followed by an optional closing angle bracket and any number of characters, followed by a closing angle bracket and the same lowercase letters as the opening tag. The backslashes () are used to escape the special characters.
IS_INTEGER ^[+-]?\d+$ This regular expression is intended to match an integer. It will match a string that starts with an optional plus or minus sign ([+-]?), followed by one or more digits (d+).
IS_IP_ADDRESS ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ This regular expression is intended to match an IP address. It will match a string that consists of four groups of digits separated by periods, where each group represents one octet of the IP address.
IS_JSON ^\s*({(.|\s)}|[(.|\s)])\s*$ This regular expression is intended to match a JSON string. It will match a string that starts and ends with curly braces or square brackets, and that may contain any number of characters in between. The caret (^) and dollar sign ($) are used to anchor the pattern to the start and end of the string, respectively, and the backslash () is used to escape the special characters.
IS_LOWERCASE ^[a-z]+$ This regular expression will match a string that consists only of lowercase letters.
IS_NOT_EMPTY ^.+$ This regular expression will match any string that is not empty. The caret (^) is used to anchor the pattern to the start of the string, the dot (.) matches any character, and the plus sign (+) indicates that the preceding character should be matched one or more times.
IS_NUMBER ^[+-]?\d+(\.\d+)?$ This regular expression is intended to match a number. It will match a string that starts with an optional plus or minus sign ([+-]?), followed by one or more digits (d+), followed by an optional decimal point and one or more digits ([.d+])?.
IS_TRUE true This regular expression will match the string "true" exactly. It is intended to be used to validate boolean values.
IS_UPPERCASE ^[A-Z]+$ This regular expression will match a string that consists only of uppercase letters.
IS_URL ^(?:http(s)?:\/\/)?[w.-]+(?:.[w.-]+)+[w-._~:\/?#[]@!$&'()*+,;=.]+$ This regular expression is intended to match a URL. It will match a string that starts with an optional "http" or "https" protocol, followed by zero or more word characters, dots, or hyphens, followed by a dot, followed by one or more word characters, dots, or hyphens, followed by one or more word characters, underscores, tildes, or other special characters.

Indian Documents

ID Pattern Description
IS_AADHAAR_NUMBER ^[0-9]{12}$ This regular expression is intended to match an Aadhaar number in India. It is a unique identification number issued by the Indian government to every individual resident of India. The regular expression will match a string that consists of exactly 12 digits.
IS_BANK_ACCOUNT_NO ^[0-9]{9,18}$ This regular expression is intended to match a bank account number in India. It will match a string that consists of 9 to 18 digits, which is the typical format of an Indian bank account number.
IS_BANK_SWIFT_CODE ^[A-Z]{4}[A-Z]{2}[0-9A-Z]{2}[0-9A-Z]{3}$ This regular expression is intended to match a SWIFT code, which is a standard format for bank identifier codes. It is used to identify financial and non-financial institutions globally. The regular expression will match a string that starts with four uppercase letters, followed by two uppercase letters, followed by two uppercase letters or digits, followed by three uppercase letters or digits.
IS_BIRTH_CERTIFICATE_NO ^[A-Z]{2}[0-9]{6}[A-Z]{1}[0-9]{2}$ This regular expression is intended to match a birth certificate number in India. It will match a string that starts with two uppercase letters, followed by six digits, followed by one uppercase letter, followed by two digits.
IS_CHEQUE_NO ^[0-9]{6,14}$ This regular expression is intended to match a cheque number in India. It will match a string that consists of 6 to 14 digits, which is the typical format of an Indian cheque number.
IS_CIN ^[A-Z]{3}[0-9]{5}[0-9A-Z]{3}$ This regular expression will match a string that represents a valid Indian CIN (Corporate Identification Number). It will match a string that starts with three uppercase letters, followed by five digits, followed by three uppercase letters or digits. CIN is a unique identification code assigned to a company or a LLP (Limited Liability Partnership) registered in India.
IS_CREDIT_CARD_NO ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$ This regular expression will match a string that consists of four groups of four digits separated by hyphens. It is a common format for credit card numbers, which consist of a series of digits that identify the card issuer, the type of card, and the account to which it is linked.
IS_DRIVING_LICENSE ^[A-Z]{2}[0-9]{2}((19|20)[0-9][0-9])[0-9]{7}$ This regular expression will match a string that represents a valid Indian driving license. It will match a string that starts with two uppercase letters and two digits, followed by a four-digit year (19xx or 20xx), followed by seven digits. The driving license is an official document issued by the government of India that allows an individual to operate a motor vehicle.
IS_GSTIN ^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$ This regular expression will match a string that represents a valid Indian GSTIN (Goods and Services Tax Identification Number). It is a 15-digit alphanumeric code used for the purpose of identification in the Indian GST system. The regex will match a string that starts with two digits, followed by five uppercase letters, followed by four digits, followed by one uppercase letter, followed by one uppercase letter or digit, followed by the letter "Z", followed by one uppercase letter or digit.
IS_IFSC_NO ^[A-Z]{4}[0][A-Z0-9]{6}$ This regular expression will match a string that starts with four uppercase letters, followed by a zero, followed by six uppercase letters or digits.
IS_MICR_CODE ^[0-9]{9}$ This regular expression will match a string that consists of nine digits.
IS_MOBILE_NO ^[6-9]\\d{9}$ This regular expression will match a string that starts with a digit from 6 to 9, followed by nine digits.
IS_NEFT_OR_RTGS_NO ^[A-Z]{4}[0-9]{7}$ This regular expression will match a string that starts with four uppercase letters, followed by seven digits.
IS_PAN_NUMBER ^[A-Z]{5}[0-9]{4}[A-Z]{1}$ This regular expression is intended to match a PAN (Permanent Account Number) in India. It is a 10-digit alphanumeric code issued by the Income Tax Department of India for the purpose of identification of taxpayers. The regex will match a string that starts with five uppercase letters, followed by four digits, followed by one uppercase letter.
IS_PASSPORT ^[A-PR-WYa-pr-wy][1-9]\\d\\s?\\d{4}[1-9]$ This regular expression will match a string that starts with a letter (uppercase or lowercase) from the range "A" to "WY", followed by a digit from 1 to 9, followed by two digits, followed by an optional space, followed by four digits, followed by a digit from 1 to 9.
IS_PHONE_NO ^[6-9]\\d{9}$ This regular expression will match a string that represents a phone number in India. It will match a string that starts with a digit from 6 to 9, followed by nine digits. This regular expression is useful for verifying the format of phone numbers in India.
IS_PINCODE ^[1-9][0-9]{5}$ This regular expression is intended to match a pincode in India. It will match a string that starts with a digit from 1 to 9, followed by five digits.
IS_PURCHASE_ORDER_NO ^[0-9]{1,5}$ This regular expression will match a string that consists of 1 to 5 digits. This regular expression is typically used to validate the format of a purchase order number.
IS_RATION_CARD_NO ^[A-Z]{3}[0-9]{7}$ This regular expression will match a string that starts with three uppercase letters, followed by seven digits.
IS_SERVICE_TAX_NO ^[A-Z]{5}[0-9]{4}[A-Z]{1}$ This regular expression is intended to match a service tax number in India. It will match a string that starts with five uppercase letters, followed by four digits, followed by one uppercase letter.
IS_SOCIAL_SECURITY_NO ^[0-9]{3}-[0-9]{2}-[0-9]{4}$ This regular expression will match a string that consists of three digits, followed by a hyphen, followed by two digits, followed by a hyphen, followed by four digits.
IS_UPI_TRANSACTION_REFERENCE_NO ^[a-zA-Z0-9]{3,128}@[a-z]{3,9}$ This regular expression will match a string that consists of 3 to 128 alphanumeric characters (letters or digits) followed by the at symbol (@) and 3 to 9 lowercase letters.
IS_VAT_TIN_NO ^[0-9]{11}$ This regular expression will match a string that represents a VAT (Value Added Tax) TIN (Taxpayer Identification Number) in India. It will match a string that consists of exactly 11 digits. This regular expression is useful for verifying the format of VAT TINs in India.
IS_VEHICLE_REGISTRATION_NO ^[A-Z]{2}[0-9]{2}((19|20)[0-9][0-9])[0-9]{6}$ This regular expression is intended to match a vehicle registration number in India. It will match a string that starts with two uppercase letters, followed by two digits, followed by a four-digit year (19xx or 20xx), followed by six digits.
IS_VOTER_ID ^[A-Z]{3}[0-9]{7}$ This regular expression will match a string that starts with three uppercase letters, followed by seven digits. It is based on the format of a voter ID in India, which consists of an elector's photo identity card (EPIC) number.

regex-patterns's People

Contributors

baijudodhia avatar

Stargazers

Ashish Shetty avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.