Regular Expression Syntax Flashcards Preview

Regular Expressions > Regular Expression Syntax > Flashcards

Flashcards in Regular Expression Syntax Deck (55)
Loading flashcards...
1

\d

Most engines: one digit from 0 to 9

2

\d

Python 3: one Unicode digit in any script

3

\w

Most engines: "word character": ASCII letter, digit or underscore

4

\s

Most engines: "whitespace character": space, tab, newline, carriage return, vertical tab

5

\D

One character that is not adigit as defined by your engine's \d

6

\W

One character that is not aword character as defined by your engine's \w

7

\S

One character that is not awhitespace character as defined by your engine's \s

8

{3}

Exactly three times

9

{2,4}

Two to four times

10

{3,}

Three or more times

11

*

Zero or more times

12

?

Once or none

13

.

Any character except line break

14

\.

A period (special character: needs to be escaped by a \)

15

\

Escapes a special character

16

\

Escapes a special character

17

|

Alternation / OR operand

18

( )

Capturing group

19

\1

Contents of Group 1

20

\2

Contents of Group 2

21

(?: )

Non-capturing group

22

\t

Tab

23

\r

Carriage return character

24

\n

Line feed character

25

\r\n

Line separator on Windows

26

+

The + (one or more) is "greedy"

27

?

Makes quantifiers "lazy"

28

*

The * (zero or more) is "greedy"

29

?

Makes quantifiers "lazy"

30

{2,4}

Two to four times, "greedy"