- Any metacharacter can be escaped using a backslash,
\
. This turns it back into a literal. So the regular expressionc\.t
means "find a c, followed by a full stop, followed by a t". - The backslash is a metacharacter, which means that it too can be escaped using a backslash. So the regular expression
c\\t
means "find a c, followed by a backslash, followed by a t". - The regular expression
c[aeiou]t
means, "find a c followed by a vowel followed by a t". In a piece of text, this will find cat, cet, cit, cot and cut. - The regular expression
[0123456789]
means "find a digit". - The regular expression
[a]
means the same as a: "find an a". - The regular expression
[ ]
means "find a space". \[a\]
means "find a left square bracket followed by an a followed by a right square bracket".[\[\]ab]
means "find a left square bracket or a right square bracket or an a or a b".[\\\[\]]
means "find a backslash or a left square bracket or a right square bracket". (Urgh!)[b-f]
is the same as `[bc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
# tty | |
# while true; do sleep 10000; done | |
f1 = open('/dev/pts/${1:1}', 'r') | |
f2 = open('/dev/pts/${1:1}', 'w') | |
import pdb | |
pdb.Pdb(stdin=f1, stdout=f2).set_trace()]]> | |
</content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/gui | |
;list with nought's moves ((1 1)(2 2)(3 3)(4 4)) | |
(define noughts '()) | |
(define (addNewNought x y) | |
(set! noughts (append noughts (list (append (cons x '()) | |
(cons y '())))))) | |
;list with cross's moves | |
(define crosses '()) | |
(define (addNewCross x y) |