<p>I have a regex that is going to end up being a bit long and it'd make it much easier to read to have it across multiple lines.</p>

<p>I tried this but it just barfs.</p>

<pre><code>preg_match(
    '^J[0-9]{7}:\s+
    (.*?)             #Extract the Transaction Start Date msg
    \s+J[0-9]{7}:\s+Project\sname:\s+
    (.*?)             #Extract the Project Name
    \s+J[0-9]{7}:\s+Job\sname:\s+
    (.*?)             #Extract the Job Name
    \s+J[0-9]{7}:\s+',
    $this-&gt;getResultVar('FullMessage'),
    $atmp
);
</code></pre>

<p>Is there are way to pass a regex in the above form to preg_match?</p>

You can use the extended syntax:
```
```
preg_match("/
    test
/x", $foo, $bar);
```
```