Regular Expression¶
How To: Basic::Regular Expression
Check for certain set of characters
Match ‘a’ followed by zero or more chars
Match ‘a’ followed by one or more chars
Match ‘a’ followed by zero or one char
Match ‘a’ followed by 3 chars
Match ‘a’ followed by anything, and ending in ‘b’
Find sequences of joined lowercase letters
Find sequences of one upper case letter
Match ‘ab’ followed by two to three chars
Match a word at the beginning
Match a word at end of string with optional punctuation
Match a word containing ‘z’
Match a word containing ‘z’, not start or end of the word
Search only upper and and lowercase, numbers, and underscores
Match string started with a specific number
Remove leading zeros from an IP address
Check for a number at the end of a string
Search the numbers (0-9) of length between 1 to 3
Search some literals strings in a string
Search a literals string in a string and pattern location
Find the substrings within a string
Find the occurrence and position of the substring
Replace whitespaces with an underscore
Extract year, month and date from an URL
Convert a date of yyyy-mm-dd format to dd-mm-yyyy format
Match if two words from a list starting with letter ‘P’
Separate and print the numbers of a given string
Find all words starting with ‘a’ or ‘e’
Separate the numbers and get their position
Replace (abbreviate) ‘road’ as ‘rd.’
Replace all occurrences of characters
Replace max 2 occurrences of characters with a colon
Find all five characters long word in a string
Find all 3, 4, and 5 characters long words
Find all words which are at least 4 characters long
Convert camel case string to snake case string
Convert snake case string to camel case string
Extract values between quotation marks
Eliminate duplicate whitespaces
Remove all whitespaces from a string
Remove everything except alphanumeric chars
Find URLs
Split a string at uppercase letters
Do a case-insensitive string replacement
Remove the ANSI escape sequences
Find all adverbs and their positions
Split a string with multiple delimiters
Check a decimal with a precision of 2
Remove words from a string of length between 1 and N
Remove the parenthesis area
Insert spaces between words