how to remember regular expression quantifications?
I have trouble remembering the quantifications, i.e i know what they all mean but does anyone have an easy way to recall which one stands for which ? ? The question mark indicates there is zero or one of the preceding element. * The asterisk indicates there is zero or more of the preceding element. + The plus sign indicates there is one or more of the preceding element. I'll give an example of the answer i'm looking for. to distinguish between horizontal and vertical, take the first letter H the line in the middle of the letter 'H' is the direction that the word denotes. the letter 'V' has two lines which go up ,so thats the direction the word means.
? is_whatever? returs boolean (0 or 1) * 0 * 1 = 0 (0 or more) + 0 + 1 = 1 (1 or more)
The question mark is a bend line which stand for 1 and a dot (a circle) which stands for zero. The asterisk is a larger dot thus zero or more. The + has a vertical line (representing one) and another one (thus one or more).
Regex match two strings but not third (in random order)
Test but not select with regex
Pattern to delete lines causes the whole contents of the file to be deleted in Sed
Using a regex in a conditional vs. an outright awk/sed?
Regex for a valid month
Remove everything except a certain pattern
Hubot Not Responding to regex
RegExp to find first letter of words before #
Creating Index based on another field in logstash
Bug in R's grepl? [closed]
Regular Expression Google Form only numbers in a range
MS Word VBA macro to search and replace (Regex)
Repeat capture group ignoring whitespaces
regex help in notepad++ marking embedded values and copying into a new list
uWSGI routing rule is overriding static files
How to match more than one pattern and delete a line using sed?