get string use regex laravel code example
Example 1: php preg match space or start of string
/\b(stackoverflow)\b/
Example 2: preg_match in php
<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php echo "Hello, World!";?>
</body>
</html>