Jump to content

Recommended Posts

Posted (edited)

_DOSWildcardsToPCRegEx (+GUI)

Posted Image

While I've posted an earlier version of this elsewhere (I will redirect to here don't worry), I figured I might as well provide a GUI interface to expose what this function does and returns, and allow its results to be copied/pasted elsewhere (like to AgentRansack, a free file-search tool supporting PC Regular Exp​ressions). So here you'll find both the GUI interface and the UDF itself.

What it does: Takes a DOS wildcard exp​ression (ex: '*.*','*.jp*g','logfiles.l?g') and converts it into a PC Regular Exp​ression. This function in its original form, _FileMatch() was originally created by RobSaunders. I altered it a bit so that it will match files just as a 'Dir' command would.

It has the potential to be used for other types of comparisons as well, but you'll need to understand that it's results will probably need to be tweaked for whatever your intentions are. If you'd like to experiment with it's results, you can try using the String Regular Exp​ression Tester (by Szhlopp), the RecursiveFileSearch (#1 version) (by WeaponX) function (which is the reason I initially worked on it), or like mentioned above, AgentRansack, a free file-search tool.

GUI interface included that does the work for you!

Download the ZIP at my Site

Ascend4nt's AutoIT Code License agreement:

While I provide this source code freely, if you do use the code in your projects, all I ask is that:

  • If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I credit
  • If the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)
  • The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.
  • Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.
Edited by Ascend4nt
Posted (edited)
Posted

That is very nice!! Now if you could write it so that it can figure out my regex for every project to know how to parse structures and div's and such from different structures like html and plain text and geesh, I could go on forever.. LOL Very nice job...

Posted

Thanks guys!

@ptrex, AgentRansack rocks :D , but hmm.. I'd rather buy their FileLocatorPro version than develop my own! Plus there's a few projects here I believe that do searches. Maybe not PCRE searches, but well.. what can you do. I don't think AutoIt is suited for searching text in files though :unsure:

@gseller - Hah, funny. That's actually part of the fun of Regular Expressions - figuring them out! There's actually a few places I can recall that help you build them.. heck, even AgentRansack has a type of expression-builder.. but I've found it more fun to figure them out! Maybe I'm a masochist though :P

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...