AutoHotkey Community

It is currently May 27th, 2012, 2:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Regex
PostPosted: August 21st, 2004, 1:11 am 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
I think AHK could use some regular expression support. I mean, we've already got a good set of functions for text and file manipulation, but I think the big one could be really useful. I, for one, make pretty frequent use of regex in all sorts tasks. Since I've started using ahk for most of my little day to day connudrums in windows, having this available would be areal boon. Maybe it could just be implemented as a function, like so:

Regex, outputvariable, options, input
options = find (returns the matches) or replace (returns modified text)

Of course for the most usage it would need to be added to if statements, which might be a more dicey proposition.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2004, 1:32 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
It's a good suggestion. I'm adding your examples to the item already on the to-do list: "StringGetPos: Support optional regular expressions." I've also raised its priority slightly.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 5:59 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
It might even be easy to implement. Maybe you should check out the Perl Compatible Regular Expression Library.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2004, 6:53 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks, that should help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2004, 3:45 pm 
Hi,

Regexps would be really nice!

Tekl


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2004, 8:53 am 
Offline

Joined: July 30th, 2004, 11:30 pm
Posts: 74
Location: Deutschland (sorry for my english)
> I think AHK could use some regular expression support.

I wanna second this request :lol:

_________________
Image Stefan

This post was created with the kindly help of http://dict.leo.org/ and remember: “Allways look on the bright side of Life”


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2004, 12:36 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks, I have raised the priority.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2004, 12:05 am 
Offline

Joined: September 2nd, 2004, 1:08 am
Posts: 124
Location: Sunnyvale
A couple of more libs that you might want to look into are:
http://www.boost.org/libs/regex/doc/index.html
http://research.microsoft.com/projects/greta/

I've used the boost lib and it is quite good.

_________________
I am he of whom he speaks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2004, 2:21 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2004, 10:25 pm 
Offline

Joined: December 14th, 2004, 10:13 pm
Posts: 1
New to autohotkey, and the only major issue I am hurting for is regular expression support. I see that it has been bumped higher in priority. A search for "regular and expression" does not show any current/recent status in the forums.

I'd like to add my request for regex support and that it be a high priority for your next release. At this moment, there's a lot of things I want to do but will take too much coding without regexp. I'm absolutely spoiled with regexp support in perl, tcl, and php.

Having regexp support almost removes the need for things like:
SetTitleMatchMode 1|2|3


Someone above posted a few url links for source code. Here's one my company uses... It's a traditional NFA regex engine, is the basis for alot of the ones listed above.

http://arglist.com/regex/

Its license is basically public domain.

TIA


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2004, 11:16 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
patord wrote:
I see that it has been bumped higher in priority. A search for "regular and expression" does not show any current/recent status in the forums.
One of the things that disappoints me about RegEx is the apparent size of the code. Due to the need to minimize the size of the scripts, it is difficult to justify adding code that would increase the EXE size by 20 or even 40 KB or more. I'm only guessing (based on source code size) about the size of these implementations; hopefully I'm wrong and there's a way to compile them to be small, or omit seldom-used features to get a "light" version.

Quote:
Having regexp support almost removes the need for things like:
SetTitleMatchMode 1|2|3
Adding RegEx support to all the windowing commands might be achievable via a #RegEx directive or some other option setting such as "SetTitleMatchMode RegEx". Thanks for the idea.

Quote:
Here's one my company uses... It's a traditional NFA regex engine, is the basis for alot of the ones listed above.
Thanks, it looks interesting so I'll research it more.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2004, 11:40 pm 
Noob question: would it be possible to use a separate AHK regex component/module which could be linked/connected/called from within a script. This way it would be up to the user to include it or not, and the original installer could/would be kept small.

Complete nonsense ???


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2004, 12:30 am 
Offline

Joined: December 5th, 2004, 7:15 pm
Posts: 13
bobo's idea might work.

chris: whay are you so concerned about increasing the size by 20 or 40K?
these days you can hardly buy computers that have small hard drives. it seems that for the vast majority of systems hard drive space is not really a big concern.

also, exe files usually compress well.

how do others feel about this? i really don't care whether or not the executable size increases or decreases by 50KB or 100KB...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2004, 1:19 am 
Offline

Joined: November 2nd, 2004, 5:06 pm
Posts: 14
size is always importatant and if there are many copies if AHK running it might use up a lot of memory. Personally I think that regex is worth it (Perl's is my personaly fav btw). I like the optional linking thing, perhaps AHK could setup some sort of dll plugin system where the plugins have to be included.

feels like a lot of work though, meh, maybe I'll look into it, ahk is open source right?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2004, 1:54 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
BoBo wrote:
Noob question: would it be possible to use a separate AHK regex component/module which could be linked/connected/called from within a script.
Simpleton wrote:
I like the optional linking thing, perhaps AHK could setup some sort of dll plugin system where the plugins have to be included.
The main thing that stops this is that compiled scripts need to be standalone because that's one of the main reasons for having them. Also, the script compiling process can't easily bring in functions from external libraries or DLLs because that type of advanced "linking" isn't part of its design.

hh wrote:
chris: whay are you so concerned about increasing the size by 20 or 40K?
It's because the size of AutoHotkey.exe is also the size of every compiled script. As someone pointed out, even a one-line script will compile to a certain minimum size (170 KB or more), even after compression.

Simpleton wrote:
feels like a lot of work though, meh, maybe I'll look into it, ahk is open source right?
It is open source. I think it would be a lot of work if you wanted to support compiled scripts while keeping them self-contained and non-dependent on any external DLLs.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group