English
Applications

Reguläre expressions testing

 

Nico
Madysa
Hello, love Community!

enclosed one small Program, the one with quick with regulären squeeze out herumexperimentieren can.
in the area for expressions can too dwelt any Escape-Sequenzen benutzen; if one means "\n" writes, becomes this too as Line break interprets.

enclosed one slight abweichender Code; in the code have I the Zeugs removes, with the I on Changes the Fenstergröße respond, because the over Subclassing and NProcs runs and a small shred How this plenty To far lead.

Download
CompileMarkSeparation
'Sorgt dafür, dass man in muster& auch Escapesequenzen benutzen kann.

proc EscapeBS

    parameters text$
    text$ = Translate$(text$,"\\z","\z")
    text$ = Translate$(text$,"\\a","\a")
    text$ = Translate$(text$,"\\b","\b")
    text$ = Translate$(text$,"\\t","\t")
    text$ = Translate$(text$,"\\f","\f")
    text$ = Translate$(text$,"\\r","\r")
    text$ = Translate$(text$,"\\n","\n")
    text$ = Translate$(text$,"\\q","\q")

    whileloop 0,255

        text$ = Translate$(text$,"\\x"+upper$(Hex$(&loop \ 16)+Hex$(&loop mod 16)),Chr$(&loop))

    EndWhile

    return Translate$(text$,"\\\\","\\")

endproc

'Aktualisiert den Titel

proc BuildTitle

    if GetText$(muster&) <> ""

        WindowTitle "RegEx-Tester: %MatchPos=" + str$(%MatchPos) + "; %MatchLen=" + str$(%MatchLen)

    else

        WindowTitle "RegEx-Tester: Kein Ausdruck!"

    endif

endproc

WindowTitle "RegEx-Tester"
cls
'Error-Level versetzt, weil sonst ständig Warnungen über
'Fehler im RegEx kommen
Set("ErrorLevel",0)
Cls External("User32","GetSysColor",15)
var Input& = Create("MultiEdit",%Hwnd,"Eingabe",0,0,width(%hWnd)\2,height(%hWnd)-20)
var Output& = Create("MultiEdit",%Hwnd,"Ausgabe",width(%hWnd)\2,0,width(%hWnd)\2,height(%hWnd)-20)
var muster& = Create("Edit",%Hwnd,"RegEx-Muster",0,height(%hWnd)-20,width(%hWnd),20)

whilenot Iskey(27)

    waitinput

    ifnot GetFocus(Output&)

        if GetText$(muster&) <> ""

            SetText Output&,Match$(EscapeBS(GetText$(muster&)),GetText$(input&))

        endif

        BuildTitle

    endif

wend
ass=s4 href='./../../function-references/XProfan/end/'>end

Notes and corrections are, How always, Welcome.

1.381 kB
Version:1
Kurzbeschreibung: Program to that Überprüfen of regulären squeeze out
Hochgeladen:03/01/12
Downloadcounter215
Download
 
03/01/12  
 



I faith if you in the hWnd-wProc with wm_eraseBkGnd 1 zurückgibst (return 1) then flickerts in Your example not at Skalieren. ^^
 
03/02/12  
 




Nico
Madysa
this specific shred is very heavy of your Ratschlägen inspired what about me give with WM_ERASEBKGND already 1 back.

The Subclassproc sees so from:
CompileMarkSeparation
nproc hWnd.Sub

    parameters wnd&,msg&,wParam&,lParam&
    var ud& = GetWindowLong(wnd&,gwl_userData)

    if msg& = WM_WINDOWPOSCHANGING

        ifnot Long(lParam&,24) & 1'Beachtet SWP_NOSIZE

            var b& = dim(16)
            GetClientRect(%hWnd,b&)
            var a& = BeginDeferWindowPos(3)
            a& = DeferWindowPos(a&,Long(ud&,0),0,\
            0,0,Long(b&,8)\2,Long(b&,12)-20,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER)
            a& = DeferWindowPos(a&,Long(ud&,4),0,\
            Long(b&,8)\2,0,Long(b&,8)\2,Long(b&,12)-20,SWP_NOACTIVATE|SWP_NOZORDER)
            a& = DeferWindowPos(a&,Long(ud&,8),0,\
            0,Long(b&,12)-20,Long(b&,8),20,SWP_NOACTIVATE|SWP_NOZORDER)
            EndDeferWindowPos(a&)
            Dispose(b&)

        endif

        return 0

    elseif msg& = WM_GETMINMAXINFO

        Long lParam&,24 = 320,240
        return 0

    elseif msg& = WM_ERASEBKGND

        return 1

    endif

    return CallWindowProc(Long(ud&,nsc_wndproc),wnd&,msg&,wParam&,lParam&)

endproc


Dass there Verbesserungspotential exists, expect I geradezu.
 
03/02/12  
 



Zur Anwendung


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.616 Views

Untitledvor 0 min.
H.Brill06/12/24
Andre Rohland09/08/18
PETER195607/18/18
Peter Max Müller03/05/17
More...

Themeninformationen

this Topic has 2 subscriber:

Nico Madysa (2x)
iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie