Sure, here are 12 examples of regex strings in a table format:
Regex String Function Usage Breakdown and Explanation
[a-zA-Z]+ Matches any word consisting of only letters, regardless of case. Used to validate input fields where only letters are allowed, such as names or usernames. [a-zA-Z] matches any single letter (case-insensitive), and + matches one or more of the preceding expression, resulting in any combination of letters.
\d{3}-\d{2}-\d{4} Matches a social security number in the format of XXX-XX-XXXX. Used for validating social security number inputs. \d matches any digit, and {3}, {2}, and {4} specify the exact number of digits to match in each group. The hyphens are also included as literal characters to match.
^(?=.[a-z])(?=.[A-Z])(?=.*\d)[a-zA-Z\d]{8,}Matchesapasswordthatcontainsatleastonelowercaseletter,oneuppercaseletter matches the end of the string.
^\d{4} matches the end of the string.
^[\w-.]+@([\w-]+.)+[\w-]{2,4} matches the end of the string.
^http[s]?://[a-z]+.[a-z]{2,} Matches a URL starting with "http://" or "https://" and ending with a domain name. Used for validating URL inputs. ^ matches the start of the string, http[s]?:// matches either "http://" or "https://", [a-z]+\. matches one or more letters followed by a period (to match the domain name), [a-z]{2,} matches the top-level domain (e.g. com, org, net), which can be between 2 and any number of characters long, and matches the end of the string.
`^
?
\d
3
?\d3?[-.\s]?\d{3}[-.\s]?\