User Tools

Site Tools


computing:regex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

computing:regex [2023/09/04 13:28] – created oscarcomputing:regex [2026/12/01 04:00] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Regex ====== 
- 
----- 
- 
-=== Characters === 
-|\d |one digit from 0 to 9| 
-|\w |word character: ASCII letter, digit or underscore| 
-|\s |whitespace character: space, tab, newline, carriage return, vertical tab| 
-|\D |One character that is not a digit| 
-|\W |One character that is not a word character )| 
-|\S |One character that is not a whitespace character | 
-|\metachar |Escape a metacharacter "%%^{+<[*)>.(|$\?|%%" | 
-|\t |Tab| 
-|\r |Carriage return character| 
-|\n |Line feed character| 
-|\r\n |Line separator| 
- 
-=== Quantifiers === 
-|a? |Zero or one of a| 
-|a* |Zero or more of a| 
-|a+ |One or more of a| 
-|[0-9]+ |One or more of 0-9| 
-|a{3} |Exactly 3 of a| 
-|a{3,} |3 or more of a| 
-|a{3,6} |Between 3 and 6 of a| 
-|a* |Greedy quantifier| 
-|a*? |Lazy quantifier| 
-|a*+ |Possessive quantifier| 
- 
-=== Character Classes === 
-|[abc] |A single character of: a, b or c| 
-|[%%^%%abc] |A character except: a, b or c| 
-|[a-z] |A character in the range: a-z| 
-|[%%^%%a-z] |A character not in the range: a-z| 
-|[0-9] |A digit in the range: 0-9| 
-|[a-zA-Z] |A character in the range: a-z or A-Z| 
-|[a-zA-Z0-9] |A character in the range: a-z, A-Z or 0-9| 
-|[\x41] |A character at hex position 41 in the ASCII table, i.e. A| 
- 
-=== Anchors === 
-|%%^%% |Start of string| 
-|$ |End of string| 
-|\A |Start of string| 
-|\Z |End of string| 
-|\z |Absolute end of string| 
-|\b |A word boundary| 
-|\B |Non-word boundary| 
-|\G |Start of match| 
- 
-=== Group Constructs === 
-|(...) |Capturing group: Match everything enclosed| 
-|(a%%|%%b) |Capturing group: Match either a or b| 
-|(?P<Y>...)|Capturing group named Y| 
-|(?:...) |Non-capturing group: Matches and does not remember the match| 
-|(?>...) |Atomic group (non-capturing)| 
-|(?%%|%%...) |Duplicate subpattern group number| 
- 
-=== Lookarounds === 
-|(?=...) |Positive Lookahead. x(?=y)Matches "x" only if "x" is followed by "y"| 
-|(?!...) |Negative Lookahead. x(?!y) Matches "x" only if "x" is followed not by "y"| 
-|(?%%<%%=...) |Positive Lookbehind (?<=y)x Matches "x" only if "x" is preceded by "y"| 
-|(?%%<%%!...) |Negative Lookbehind (?<!y)x Matches "x" only if "x" is not preceded by "y"| 
- 
-==== Cheat sheets ==== 
-  * [[https://www.rexegg.com/regex-quickstart.html#classes]] 
-  * [[https://quickref.me/regex.html]] 
-  * [[https://www.datacamp.com/cheat-sheet/regular-expresso]] 
- 
-==== Online Testers ==== 
-  * [[https://www.regextester.com/|Regextester]] 
-  * [[https://regexr.com/|Regexr]] 
- 
-==== Links ==== 
-  * [[http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Filters|Fail2ban Regex]] 
  
computing/regex.1693834101.txt.gz · Last modified: by oscar