<?xml version="1.0" encoding="windows-1252"?>
<node id="481804" title="Re: Regex question" created="2005-08-08 02:44:05" updated="2005-08-10 17:25:44">
<type id="11">
note</type>
<author id="169829">
Enlil</author>
<data>
<field name="doctext">
The difference is that with &lt;code&gt;[]&lt;/code&gt; is part of a character class, which means that anything (in this case a line) within the &lt;code&gt;[]&lt;/code&gt; will constitute a match at this position. So in your code, &lt;code&gt;[htm|asp]&lt;/code&gt; anything that contains any of the following characters will match:&lt;code&gt; h t m | a s p&lt;/code&gt;.
&lt;p&gt;
On the other hand with parenthesis you are asking the regex engine to match anything with &lt;code&gt;htm&lt;/code&gt; OR &lt;code&gt;asp&lt;/code&gt;, and hence output.php doesn't match.&lt;p&gt; You might want to have a look at [doc://perlretut] and [doc://perlre] for more info.
&lt;p&gt;
-enlil</field>
<field name="root_node">
481801</field>
<field name="parent_node">
481801</field>
</data>
</node>
