<?xml version="1.0" encoding="windows-1252"?>
<node id="967861" title="Re^3: Help with placing the matches of a regex into an Array" created="2012-04-28 16:47:16" updated="2012-04-28 16:47:16">
<type id="11">
note</type>
<author id="699288">
JavaFan</author>
<data>
<field name="doctext">
It depends on the data -- if the data is incorrectly formatted (a missing ' for instance), they may not do the same thing. And &lt;c&gt;'.+?'&lt;/c&gt; has the tendency to be slower than &lt;c&gt;'[^']+'&lt;/c&gt;. Usually, the more restrictive a pattern is, the faster: there's less opportunity to backtrack. There's much more commitment in &lt;c&gt;'[^']+'&lt;/c&gt; then there is in &lt;c&gt;'.+?'&lt;/c&gt;: the former will always match two quotes in succession, and whatever is in between, regardless how the rest of the pattern looks like, but that's not the case with &lt;c&gt;'.+?'&lt;/c&gt;; there's nothing stopping the &lt;c&gt;.+?&lt;/c&gt; part to match quotes.</field>
<field name="root_node">
967819</field>
<field name="parent_node">
967860</field>
</data>
</node>
