"""String monomers — real implementations."""

import re


def concat(a: str, b: str) -> str:
    return a + b


def split(s: str, sep: str) -> list[str]:
    return s.split(sep)


def substr(s: str, start: int, length: int) -> str:
    return s[start:start + length]


def len_str(s: str) -> int:
    return len(s)


def upper(s: str) -> str:
    return s.upper()


def lower(s: str) -> str:
    return s.lower()


def trim(s: str) -> str:
    return s.strip()


def match_str(s: str, pattern: str) -> bool:
    return bool(re.search(pattern, s))
