Perl is also the name of a municipality in Saarland, Germany. Perl functions, variables, operators, regular expressions. Perl cheat sheet. Sh Scripting Cheat Sheet. And since we’d rather use perl, sh syntax leaves our brains faster than thirteen year old can hack a Windows system. The bad news is: sh has a lot of condition operators. Who can remember them all? It helps to have a cheat sheet. Binary operators -eq (arg1 is equal to arg2) -ne (arg1 is not equal to arg2) -lt. A perl regular expression usually comes in something like this: Here we divide the expression into 4 parts: = Match Operators, the operator between the variable and the expression m// Quote-like Operators, appears after match operator /i Options, the modifiers after the expression PATTERN the Expression Match Operators = This operator appears between the string. Operators to determine whether a file or directory exists Here are the most common Perl file test operators that can be used to determine whether a file or directory exists: -e File or directory name exists -z File exists and has zero size -s File or directory exists and has non-zero size.
When learning regexes, or when you need to use a feature you have not used yet or don't use often, itcan be quite useful to have a place for quick look-up. I hope this Regex Cheat-sheet will provide such aid for you.
Regex Character Classes and Special Character classes.
TODO: add examples w and d matching unicode letters and numebers.
'Quantifier-modifier' aka. Minimal Matching
Grouping and capturing
Perl Operators Cheat Sheet
Perl Operators Cheat Sheet Excel
Other Regex related articles
Published on 2015-08-19