from typing import Optional
import re


def extract_tweet_id(string: str) -> Optional[int]:
    """
    This method is used to search for the tweet id in a given string and return it.

    # Arguments

    * `string: str` - A string to look for the tweet id in.

    # Returns

    * `Optional[int]` - Returns an integer of the tweet id when it is found. If it's not 
    found then None is returned.
    """

    matches: list = list(map(int, re.findall(r'twitter\.com\/.*\/status(?:es)?\/([^\/\?]+)', string)))
    return None if not matches else matches[0]