w0uter Posted September 26, 2005 Share Posted September 26, 2005 (edited) [edit] JON you should really fix the code-tag it looks so sloppy. im a bad coder [/edit] this app was designd to easy test regexp patterns on the fly. in like ~4 hours, since i ran into that regexp bug. thought i got all the bugs out but if you find one let me know. expandcollapse popup#include <GuiConstants.au3> GUICreate("StringRegExp Design GUI -by w0uter", 550, 500, (@DesktopWidth - 550) / 2, (@DesktopHeight - 500) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateGroup("The text to check", 10, 10, 530, 130) GUICtrlCreateGroup("The pattern", 10, 150, 530, 50) GUICtrlCreateGroup("Output", 140, 210, 400, 280) GUICtrlCreateGroup("Return", 10, 210, 120, 100) GUICtrlCreateGroup("@Error", 10, 320, 120, 50) GUICtrlCreateGroup("@Extended", 10, 380, 120, 50) $h_Radio_0 = GUICtrlCreateRadio("True/False", 20, 230, 100, 20) $h_Radio_1 = GUICtrlCreateRadio("Array with the text", 20, 251, 100, 27) $h_Radio_3 = GUICtrlCreateRadio("Array of all results", 20, 280, 100, 20) GUICtrlSetState($h_Radio_3, $GUI_CHECKED) $h_In = GUICtrlCreateEdit("", 20, 30, 510, 100) $h_Out = GUICtrlCreateList("", 150, 226, 380, 262) $h_Pattern = GUICtrlCreateInput("(.*)", 20, 170, 510, 20) $h_Err = GUICtrlCreateInput("0", 20, 340, 100, 20, $ES_READONLY) $h_Ext = GUICtrlCreateInput("bla", 20, 400, 100, 20, $ES_READONLY) $h_Exit = GUICtrlCreateButton("Exit", 10, 440, 120, 50) $v_Reg_Old = 0 GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $h_Exit ExitLoop EndSwitch _Valid() WEnd Func _Valid() $v_Reg = StringRegExp(GUICtrlRead($h_In), GUICtrlRead($h_Pattern), _Option()) Dim $v_EE[2] = [@error, @extended] If $v_EE[0] = 2 Then GUICtrlSetColor($h_Pattern, 0xFF0000) GUICtrlSetData($h_Err, $v_EE[0]) GUICtrlSetData($h_Out, "") Else GUICtrlSetColor($h_Pattern, 0) GUICtrlSetData($h_Err, $v_EE[0]) EndIf GUICtrlSetData($h_Ext, $v_EE[1]) If $v_EE[0] <> 2 Then $v_Check = 0 If UBound($v_Reg) <> UBound($v_Reg_Old) Then $v_Check = 1 Else For $i = 0 To UBound($v_Reg) - 1 If $v_Reg[$i] <> $v_Reg_Old[$i] Then $v_Check = 1 Next EndIf If $v_Check = 1 Then GUICtrlSetData($h_Out, "") If UBound($v_Reg) Then For $i = 0 To UBound($v_Reg) - 1 GUICtrlSetData($h_Out, $i & ' = ' & $v_Reg[$i]) Next Else GUICtrlSetData($h_Out, $v_Reg) EndIf EndIf EndIf $v_Reg_Old = $v_Reg StringRegExp('', Random(0x80000000, 0x7FFFFFFF), 1) EndFunc ;==>_Valid Func _Option() Switch $GUI_CHECKED Case GUICtrlRead($h_Radio_0) Return 0 Case GUICtrlRead($h_Radio_1) Return 1 Case GUICtrlRead($h_Radio_3) Return 3 EndSwitch EndFunc ;==>_Option Edited September 26, 2005 by w0uter pixelsearch 1 My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted September 26, 2005 Author Share Posted September 26, 2005 small bugfix on the list: it was displaying 1 on an invalid pattern. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted September 27, 2005 Author Share Posted September 27, 2005 if noone replies, i will stop making stuff that help's people... its clear that noone is interested. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
jpm Posted September 27, 2005 Share Posted September 27, 2005 I try this text "ceci est un test" with this pattern "est". nothing show up is it normal? Link to comment Share on other sites More sharing options...
w0uter Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) i think it is since you dont have an Group.( ... ) Group. The elements in the group are treated in order and can be repeated together. e.g. (ab)+ will match "ab" or "abab", but not "aba". A group will also store the text matched for use in back-references and in the array returned by the function, depending on flag value. try "ceci est un test" with this pattern "(est)". Edited September 27, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
jpm Posted September 27, 2005 Share Posted September 27, 2005 i think it is since you dont have an Group.try "ceci est un test" with this pattern "(est)".does a group is always needed? if yes why not to add a clear error message explaining the @error/@extended valuesYou know I am not an expert in regexp. Link to comment Share on other sites More sharing options...
w0uter Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) how about red = invalid pattern orange = needs a group black = correct pattern and make @error 0/2 -> Error: None / Invalid pattern (and maby / No Group) @extended 0/1 -> Matched: Yes / No btw thanx for showing interest Edited September 27, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
jpm Posted September 27, 2005 Share Posted September 27, 2005 how about red = invalid patternorange = needs a groupblack = correct patternand make @error 0/2 -> Error: None / Invalid pattern (and maby / No Group)@extended 0/1 -> Matched: Yes / Nobtw thanx for showing interest Why to use only color?just update a label with color if you want to display the error Link to comment Share on other sites More sharing options...
w0uter Posted September 27, 2005 Author Share Posted September 27, 2005 hmm, im lost in my own code due to all those spagetti work-arounds for that StringRegExp bug.ive decided to give up this project till they will fix the bug. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
ligenza Posted September 28, 2005 Share Posted September 28, 2005 hmm, im lost in my own code due to all those spagetti work-arounds for that StringRegExp bug.ive decided to give up this project till they will fix the bug.Be sure to post it in the proper Bug report forum. I see that your linked post is in the Support forum, I think it makes a difference. Thanks for working on this function by the way. Most of the community doesn't seem to post much. I know how it is working on stuff and then getting annoyed by the apparent lack of intrest. It is indeed sad when the most viewed thread is drama related or about girls, but what can you do. Link to comment Share on other sites More sharing options...
Confuzzled Posted September 28, 2005 Share Posted September 28, 2005 if noone replies, i will stop making stuff that help's people...its clear that noone is interested. Um, very seriously interested, but patiently waiting the bug fix without applying too much pressure... Link to comment Share on other sites More sharing options...
jpm Posted September 28, 2005 Share Posted September 28, 2005 just some new about Nutster who should fix soon I hope the problem. It has broken his dev environment and he try to recover in a couple of day. Thanks for your patience. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now