from typing import Optional
import re


def get_patch_notes_line_number(commentBody: str) -> Optional[int]:
    """
        Returns the first integer from the comment body

        Returns None if no valid integer can be found
        """
    comment_first_line = commentBody.partition("\n")[0]
    number_line_match = re.search(r"\d+", comment_first_line)
    if number_line_match is None:
        return None

    return int(number_line_match.group())