Re: Regular expression help
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
wrote:
Need to parse through our code files and find every instance of other
files referenced, looking for included files, images, etc. The
expression I'm using is
("|')(.*)(\.asp|\.htm(l)?|\.gif|\.jpg)("|')
Which works great.
Now what I need to do and can't figure out is how to exclude certain
matches, as in
<!--#include file="../../myincludefiles/sqlConnection.asp"-->
<a href="http://www.ourserver.com/somebranchfile.asp">
I don't want anything (for instance) that includes the strings
'myincludefiles' or 'http' inside the quotes.
Assuming you don't want to match strings that *start* with "http":
("|')(?!http|.*?myincludefiles).*?(?:\.asp|\.html?|\.gif|\.jpg)\1"
The change to exclude strings the include "http" anywhere is trivial
(see the pattern for excluding "myincludefiles:).
--
Steve
When you have to make a choice and don't make it, that is in itself a
choice. -William James
.
Relevant Pages
- Re: Global Image Of MS Expresses Through Photographic Exhibit
... Click on "The Exhibit" to see the images and the stories. ... see some of the one line quotes. ... I have a lot of anger. ... (alt.support.mult-sclerosis) - Re: Global Image Of MS Expresses Through Photographic Exhibit
... Click on "The Exhibit" to see the images and the ... left to see some of the one line quotes. ... I have a lot of anger. ... (alt.support.mult-sclerosis) - Re: rm -rf "/path/to/files/*.*" 2>&1 fails and throws no errors/warnings
... I need a Unix/Windows equivalent to delete all files at once from a ... you don't want to put the arguments to rm in quotes. ... [lists the very same 30 images] ... (comp.unix.shell) - Re: Simple image swap not working...Why?
... because you did not enclose the URI string in quotes: ... but I didn't include the quotes. ... The pathnames to your images are probably wrong. ... but adding either the path to root or a single period would. ... (comp.lang.javascript) - Re: Huge delay in Opening Presentation
... Geetesh Bajaj, Microsoft PowerPoint MVP ... "James Bishop" wrote in message ... I am the Audio Visual Technician in the preparation> room who has to check these and link them to the title> slides and network them to the rooms. ... Most of the web> images I see are in fact the sponsors and product logos,> all above board I'm Sorry. ... (microsoft.public.powerpoint) |
|