<p>What is the RegEx pattern for DateTime (2008-09-01 12:35:45 ) ?</p>

<p>I get this error:</p>

<blockquote>
  <p>No ending delimiter '^' found</p>
</blockquote>

<p>Using:</p>

<pre><code>preg_match('(?n:^(?=\d)((?&lt;day&gt;31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?&lt;sep&gt;[/.-])(?&lt;month&gt;0?[1-9]|1[012])\2(?&lt;year&gt;(1[6-9]|[2-9]\d)\d{2})(?:(?=\x20\d)\x20|$))?(?&lt;time&gt;((0?[1-9]|1[012])(:[0-5]\d){0,2}(?i:\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$)', '2008-09-01 12:35:45');
</code></pre>

<p>Gives this error: </p>

<blockquote>
  <p>Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 0 in E:\www\index.php on line 19</p>
</blockquote>

http://regexlib.com/REDetails.aspx?regexp_id=610
^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d(?:(?=\x20\d)\x20|$))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$
This RE validates both dates and/or
  times patterns. Days in Feb. are also
  validated for Leap years. Dates: in
  dd/mm/yyyy or d/m/yy format between
  1/1/1600 - 31/12/9999. Leading zeroes
  are optional. Date separators can be
  either matching dashes(-), slashes(/)
  or periods(.) Times: in the hh:MM:ss
  AM/PM 12 hour format (12:00 AM -
  11:59:59 PM) or hh:MM:ss military time
  format (00:00:00 - 23:59:59). The 12
  hour time format: 1) may have a
  leading zero for the hour. 2) Minutes
  and seconds are optional for the 12
  hour format 3) AM or PM is required
  and case sensitive. Military time 1)
  must have a leading zero for all hours
  less than 10. 2) Minutes are
  manditory. 3) seconds are optional.
  Datetimes: combination of the above
  formats. A date first then a time
  separated by a space. ex) dd/mm/yyyy
  hh:MM:ss
Edit
: Make sure you copy the RegEx from the regexlib.com website as StackOverflow sometimes removes/destroys special chars.