RegexTutorials

These are tests based on the exercises on REGEXTUTORIALS.

These tests are based on the exercises found on http://regextutorials.com/index.html

class tests.test_regextutorials.RegexTutorials(methodName='runTest')
test_Floating_point_numbers()

This test is exercise 1 http://regextutorials.com/excercise.html?Floating%20point%20numbers

Match numbers containing floating point. Skip those that don’t.

Speed of light in vacuum 299792458 m/s

Standard atmosphere 101325 Pa

Earth to sun distance 149600000 km

Acceleration of gravity 9.80665 m/s^2

Circumference to diameter ratio 3.141592

Gas constant 8.3144621 J/mol*K

test_Greyscale_colors()

This is test exercise 4 http://regextutorials.com/excercise.html?Grayscale%20colors

Match 12 and 24 bit colors whose red, green and blue components are equal. Colors start with a ‘#’. Greyscale colors are those that have the same rgb value

24 bit:

Alice Blue #F0F8FF

Black #000000

Antique White #FAEBD7

Dark Grey #a9a9a9

Aqua #00FFFF

Azure #F0FFFF

Battleship grey #848484

12 bit:

White #FFF

Red #F00

Green #0F0

Black #000

test_Hexadecimal_colors()

This test is exercise 3 http://regextutorials.com/excercise.html?Hexadecimal%20colors

Match 24-bit hexadecimal colors. Skip 12 bit colors.

24 bit:

AliceBlue #F0F8FF

AntiqueWhite #FAEBD7

Aqua #00FFFF

Aquamarine #7FFFD4

Azure #F0FFFF

12 bit:

White #FFF

Red #F00

Green #0F0

Blue #00F

test_Long_lines()

This is exercice 5 http://regextutorials.com/excercise.html?Too%20long%20lines

Match lines that are more than 30 characters long.

This line is way too loooooooooooong.

This one is fine too.

This line is also too long…………….

test_Years_before_1990()

This is exercise 2 http://regextutorials.com/excercise.html?Years%20before%201990

Match titles of all films produced before 1990.

1 The Shawshank Redemption (1994)

2 The Godfather (1972)

3 The Godfather: Part II (1974)

4 Pulp Fiction (1994)

5 The Good, the Bad and the Ugly (1966)

6 The Dark Knight (2008)

7 12 Angry Men (1957)

8 Schindler’s List (1993)

9 The Lord of the Rings: The Return of the King (2003)

10 Fight Club (1999)