AutoHotkey Community

It is currently May 27th, 2012, 11:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: July 10th, 2011, 10:45 pm 
Offline

Joined: March 10th, 2011, 7:17 pm
Posts: 374
lol.

that is one long regex. i doubt you need a code license cause no one is gonna bother reversing that haha


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2011, 2:43 am 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Why not? We have discussed that many times. No license means very different problems in different countries. The choosen license allows explicitly to use, edit and share the code. And that the code`s heart consists basically of one single regex call does not mean that it is trivial.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2011, 5:19 am 
Offline

Joined: March 10th, 2011, 7:17 pm
Posts: 374
no no you misunderstood hehe :)

i was making a joke. clearly that regex is non trivial. thats probably the most complex regex i've ever seen!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2011, 5:40 am 
Oh... sorry :o
The regex is build up of a repetitive pattern, up to 32 times with only small changes. I could use a Loop (in one variant of the function i do), but it is more efficient to use a prebuild one. Thats why it looks that giant.^^


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2012, 3:21 pm 
Offline

Joined: January 23rd, 2012, 9:13 am
Posts: 18
Tuncay wrote:
AHK_L
Just in case someone is interested in it. ... This function is all you need and the most simple one to work with, as it works with objects. Very powerful imo. No need to include the original argp.ahk library.

Usage example:
Code:
args := "-input notes.txt"
options := getopt(args)
msgbox % options.input ; shows notes.txt

I am interested! But when I try your exact example AHKL never returns from RegExMatch() and CPU shoots up to 80%. I'm using AHKL 1.1.05.06 Win7 SP1 32-bit. Getopt() is #included and the script is compiled.

edit: It seems to be a regex size issue. I shortened the regex (and Loop) to 16 elements and now it works.
Other changes I made in my own version - which isn't included in this thread; contact me if you need it:
* replaced "" (double quote + double quote) with a single \x22 throughout the regex (to improve syntax highlighting in my editor)
* changed a-zA-Z0-9_ to \w


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2012, 9:04 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Sorry for late reply (no internet connection for a while).

I don't know why the regex should make such an issue, as the function is tested. May be thats due to some internal changes in AutoHotkey??

Do you use Unicode build of AHK? And how well performs it with actual AHK version? And what is the test script, which fails?

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2012, 10:45 am 
Offline

Joined: January 23rd, 2012, 9:13 am
Posts: 18
Tuncay wrote:
Do you use Unicode build of AHK?
AHKL unicode build 1.1.5.6.
Quote:
And how well performs it with actual AHK version?
Sorry, I'm not sure I understand your question. I didn't do any performance comparisons between getopt versions. I just went directly for your object getopt because I liked it.
Quote:
And what is the test script, which fails?
Anything, even the simplest command-line like -x=1, failed until I set the limit to 16 instead of 32.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2012, 3:02 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Thanks for reporting. I have tested it against older AutoHotkey versions and found out, the function is broken since 1.1.05.00 - October 8, 2011. The changes which could have an effect are:
(from http://l.autohotkey.net/docs/AHKL_ChangeLog.htm)

- Added object output mode for RegExMatch and RegEx callouts.
- Modified PCRE to use UTF-16 for input on Unicode builds, for performance.
- Upgraded PCRE to 8.13.
- Fixed RegEx callouts not causing matching to abort when an exception is thrown.

when he tried to improve the RegEx, my guess. I am not interested to work on it anymore. You can download older versions of AHK if you like here: http://l.autohotkey.net/v/
I'll send Lexikos a message, so he can look at it again if he like. It could be a bug.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2012, 5:56 pm 
Offline

Joined: January 23rd, 2012, 9:13 am
Posts: 18
OK, fine. I can still use it with a 16 option limit (maybe more, I didn't test). 16 is plenty for me. Thank you for developing it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2012, 11:16 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
I found a typo, in case you have not seen it:

Its _n6:="" instead of _n16:=""

It seems the only way getting it to work "back" is by reducing the elements. I think, the regex backtracks too often.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: nothing 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