CONTEXT:
------------
When I noticed this possible bug, I was/am in the middle of creating a regex, therefore it is not completed.
I have a regex like the following:
^(((.*/)+)|(.*\.(html?|php3?|asp)))\"
It is actually part of an AWK script in UNIX that deals with web page links essentially. The regex is used to filter on input like the following:
index.html" title="some other attribute">go to the home page
images/logo.gif" alt="Logo" />
The top is from a html <a href...> tag and the second is from a <img src=...> tag.
The BUG (maybe):
---------------------
Now in regex builder when I change my regex from:
^(((.*/)+)|(.*\.(html?|php3?|asp)))\"
To:
^(((.*/?)+)|(.*\.(html?|php3?|asp)))\"
(only the ? was added)
it eats up the computer resources for a few seconds while it thinks about it.
Now I know this may be simply due to the fact that the first half of the regex
(on the left of the |) essentially allows anything (since it says I want 1 or more
of something that may actually be nothing: (.*/?)+ )
i.e.
(.*/?) <---- this is free to match anything, including the empty string
(.*/?)+ <---- therefore this matches one or more of something that could be the empty string...which is the empty string (I suppose)
I don't know whether this is really a bug or is just because the regex is slightly odd and simply requires more thinking time.