Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP REG EXP backtrack issue
    primarykey
    data
    text
    <p>I'm trying to use this reg exp in PHP in a preg_match_all</p> <pre><code>/\d+ (?:&lt;[^&gt;]+&gt;)(?:&lt;[^&gt;]+&gt;)(\S+.*\S+)(?:&lt;[^&gt;]+&gt;)\s*(\S+) (?:L|R)\s*\w* \w*\s*(?:\w+\s*){14}(\d+)\s*(\d)\s*(\d*\xA0*\d{3}\xA0*\d{3})/is </code></pre> <p>There's some data sample :</p> <pre><code>38 &lt;A NAME="Philip McRae"&gt;&lt;A HREF="xtrastats.html#Philip McRae"&gt;Philip McRae&lt;/A&gt; C L OK 58 71 69 49 33 89 71 45 48 69 50 35 32 61 21 3 787 000 43 &lt;A NAME="Alexander Nikulin"&gt;&lt;A HREF="xtrastats.html#Alexander Nikulin"&gt;Alexander Nikulin&lt;/A&gt; C L OK 41 68 71 40 28 90 67 29 31 60 31 37 34 50 26 0 0 000 &lt;a href="http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=78680" target="_blank"&gt;HDB&lt;/a&gt; 20 &lt;A NAME="Christian Hanson"&gt;&lt;A HREF="xtrastats.html#Christian Hanson"&gt;Christian Hanson&lt;/A&gt; C R OK 57 72 71 54 33 79 70 42 45 71 46 40 36 60 25 1 875 000 &lt;a href="http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73824" target="_blank"&gt;HDB&lt;/a&gt; </code></pre> <p>I got around 1500 lines. </p> <p>I need to match this :</p> <pre><code>Philip McRae, C, 21, 3, 787 000 (Name, Position, Age, Contract Lenght, Salary) </code></pre> <p>Each time I run my code, I got an Fatal error: Maximum execution time of 30 seconds exceeded error.</p> <p>After some search I add this line at top of my script but that's not solve my problem</p> <pre><code>ini_set("pcre.backtrack_limit",10000000); </code></pre> <p>Anyone can help me with this reg exp for some optimisation ?</p> <p>Regards.</p> <p>Patrick</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload