Perl Operators Cheat Sheet

Posted : admin On 1/2/2022

PrevNext

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.

Character Classes

Regex Character Classes and Special Character classes.

TODO: add examples w and d matching unicode letters and numebers.

Quantifiers

Cheat

'Quantifier-modifier' aka. Minimal Matching

Other

Grouping and capturing

Perl Operators Cheat Sheet

Anchors

Perl Operators Cheat Sheet Excel

Modifiers

Extended

Other Regex related articles

Official documentation

Published on 2015-08-19

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus

Perl Regular Expression Cheat Sheet

If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.