Simple regex (python vs javascript)

What am I doing wrong?

I am searching the matchs in a url, for example

import re

pattern = 'github'
str = 'https//github.com'
x = re.match(pattern, str)
print(x)
# prints None

However, I do the same in javascript:

console.log('https://github.com'.match(/github/))
// prints ["github", index: 8, input: "https://github.com", groups: undefined]

Why do not python see the match?

Python match is different from JavaScript match. Python match looks only at the start of the string. The Python method roughly equivalent to JavaScript’s match is called search. See also this Stack Overflow answer.

I fix my code with re.search(). Thanks @lionel-rowe.