title: Laravel: Common Regex For route pattern and Model validation
body: <p>Situation where I came across:
  Consider the following cases :</p>
  
  <ol>
  <li><code>Route::pattern()</code> or we can use <code>Route::({method}/{keyword})-&gt;where('keyword', {regex});</code></li>
  <li>Validation Rule <code>array( 'keyword' =&gt; "/^{regex}$/");</code></li>
  </ol>
  
  <p>Both accepts different format of regex
  in case 1: <code>Route::pattern()</code> or in <code>Route::()-&gt;where()</code> it does not accept regex in /^{regex}$/ format. It only accepts <code>Route::pattern('keword', {regex})</code>.</p>
  
  <p>in case 2: its accepts regex in <code>/^{regex}$/</code> pattern.</p>
  
  <p>So in short, I can't apply the same in both place. That is why I have to write two different regex, however they are same.</p>
  
  <p>Am I missing something? Is that possible that model regex and route pattern regex can be defined at once? So changing one regex, we dont have to change another one. Just because of  /^$/ ?</p>