wp PHP: a MySQL8 query using REGEXP with double backslash. Can I avoid using \\?

Due to the fact I have over 100,000 posts, I am using MySQL directly instead of wp codex for testing complex regexs for adding tags.
To also test results quickly in a visual format, I created a wordpress search page that uses the same SQL statement directly. This works with no problems unless there are escaped regex characters, such as b, which in a MySQL8 statement is \b.
If I use that exact statement in PHP, the double backslash is not recognised.