title: Validating latitude/longitude in Laravel validation regex rule - preg_match(): No ending delimiter '/' found
body: <p>I am trying to validate latitude/longitude in Laravel 5.4 project with custom regex rule (based on this answer: <a href="https://stackoverflow.com/a/22007205/2332336">https://stackoverflow.com/a/22007205/2332336</a>)</p>
  
  <pre><code>// Create validation
  $validator = Validator::make($request-&gt;all(), [
      // ...
      'lat' =&gt; 'required|regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
      'long' =&gt; 'required|regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
  ], [
      'lat.regex' =&gt; 'Latitude value appears to be incorrect format.',
      'long.regex' =&gt; 'Longitude value appears to be incorrect format.'
  ]);
  
  // Test validation
  if ($validator-&gt;fails()) {
      return redirect()
          -&gt;back()
          -&gt;withErrors($validator)
          -&gt;withInput();
  }
  </code></pre>
  
  <p>When this runs, I am getting the following error:</p>
  
  <blockquote>
    <p>preg_match(): No ending delimiter '/' found</p>
  </blockquote>
  
  <p>I've tried this also;</p>
  
  <pre><code>    'lat' =&gt; 'required|regex:^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$',
      'long' =&gt; 'required|regex:^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$'
  </code></pre>
  
  <p>Now I get this error:</p>
  
  <blockquote>
    <p>preg_match(): No ending delimiter '^' found</p>
  </blockquote>
  
  <p>What is the correct syntax to validate lat/lng in laravel via custom regex rule?</p>