Asked in Questions about WikiAnswers and Answers.comDefinitionsExample SentencesPrefixes Suffixes and Root Words
Questions about WikiAnswers and Answers.com
Prefixes Suffixes and Root Words
What is word boundary in regular expression?
Asked in Definitions
What is difference between regular expression and regular definition in compiler?
Asked in Plate Tectonics
What type of plate boundary boundary is regular light tremor?
What is the application of regular expression in compiler construction?
What is better Finite Automata or Regular Expression?
Asked in PHP Programming, Computer Programming
What is a regular expression?
In programming, a regular expression is an expression that explains a pattern for a string. A string matches a regular expression if that string follows the pattern of that regular expression. For example, you may want to create an account system, allowing usernames to only have uppercase and lowercase letters, and numbers. While a user is registering, you can check their desired username against a regular expression involving only alphanumeric characters (A-Z, a-z, 0-9). If it matches, then the username is valid to your requests. If it does not, the user has put in a character that does not follow the pattern of the regular expression. In regular expressions, you can match certain characters, match a certain quanity of characters, match the casing of characters (or just ignore it overall), and plenty more. The syntax of a regular expression varies throughout every programming language, but Perl is often used due to its wide variety of options. Perl is also incorporated into many web languages, such as PHP, making regular expressions less of a hassle. This is an example of a Perl regular expression, allowing a string with only alphanumeric characters (any character case), and an infinite length (except for a string with no length or no characters, in which the regular expression does not match the string): /^(?i)[a-z0-9]+$/