What are some resources or tutorials that explain the use of regular expressions in PHP for beginners, especially in the context of manipulating URLs?

Regular expressions can be used in PHP to manipulate URLs by matching and extracting specific patterns from the URL strings. This can be useful for tasks such as extracting parameters, validating URLs, or rewriting URLs. Beginners can refer to resources or tutorials that explain the basics of regular expressions in PHP and how to apply them in the context of URL manipulation.

$url = "https://www.example.com/page?id=123&category=books";

// Extracting parameter values from the URL using regular expressions
preg_match('/\?id=(\d+)&category=(\w+)/', $url, $matches);

$id = $matches[1];
$category = $matches[2];

echo "ID: $id, Category: $category";