Sign in to follow this  
Followers 0
goldenix

[solved] Stringregexp & Recrusive Function help

3 posts in this topic

#1 ·  Posted (edited)

Run sample 1 first, It works fine. Now run only sample 2 & see the difference. Why on earth is it showing not clean string?

Global $check_if_clean_string       = '[<>~@-_;:"\[\]\.\,\+\!\%\?\#\*]'

;Sample 1
;~ ============================================================================================================
$STRING = '[desudesu] Finecraft69 (6ro-) - Shinsekai Taisei - Seikishi Kyousei Jutai- (VIPER RSR)(C75).rar'
_Check_If_Clean_String($STRING)

$STRING = "[desudesu] Matsumoto Drill Kenkyuujo - manga study's Fujiki-San.rar"
_Check_If_Clean_String($STRING)
;~ ============================================================================================================

;Sample 2
;~ ============================================================================================================
;~ $STRING = '[desudesu] Finecraft69 (6ro-) - Shinsekai Taisei - Seikishi Kyousei Jutai- (VIPER RSR)(C75).rar'
;~ _Populate_string_Array($STRING)

;~ $STRING = "[desudesu] Matsumoto Drill Kenkyuujo - manga study's Fujiki-San.rar"
;~ _Populate_string_Array($STRING)
;~ ============================================================================================================


Func _Populate_string_Array($STRING)
;~  -----------------------------------------------------------------------------------------
    $Check_If_Clean_String = _Check_If_Clean_String($STRING) ; if clean returns Filename , else 0
;~  -----------------------------------------------------------------------------------------
EndFunc

Func _Check_If_Clean_String($STRING)    ;## Pet Life.rar

;## see if its a clean filename like Pet Life.rar
    $regexp = StringRegExp($STRING,$check_if_clean_string) ; Returns 1= match , 0 = no macth

    If StringInStr($STRING,'(') Or StringInStr($STRING,')') Then  $regexp = 1

    ConsoleWrite(@CRLF & '====================================================================' & @CRLF)
    ConsoleWrite($STRING & @CRLF)
    If $regexp = 1 Then ConsoleWrite($regexp & ' <---Not clean string' & @CRLF)
    If $regexp = 0 Then ConsoleWrite($regexp & ' <---clean string' & @CRLF)
    ConsoleWrite('====================================================================' & @CRLF)


    If $regexp = 0 Then     ; clean
        $return = $STRING
    Else
        $return = 0
    EndIf

    Return $return
EndFunc
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites



Because you are changing $Check_If_Clean_String.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Because you are changing $Check_If_Clean_String.

Ooh, thanx :D


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0