Task: Escape Special Regex Characters in PHP
Task: Escape Special Regex Characters in PHP: a task in Terminal-Lego-15k (Harbor dataset). Write a PHP script that escapes strings containing special regex metacharacters so they can be safely used as literal patterns inside regular expressions. This is analogous to C 's Regex.Escape() function.
The task
Write a PHP script that escapes strings containing special regex metacharacters so they can be safely used as literal patterns inside regular expressions. This is analogous to C#'s `Regex.Escape()` function.
Part of PrimeIntellect/Terminal-Lego-15k.