﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3856	FileOpenDialog passing unseen information	anonymous		"The summary is the best I could describe it and is an assumption. See link starting at post 4
https://www.autoitscript.com/forum/topic/207124-regexp-assistance-please/ for a better perspective.

Passing a file list to an array from the fileopendialog function puts something in the array that is messing with regexp functions. If I pass the same exact information from a ""manually built array"" of information the regexp will work with no issue.


{{{
$FileSelect = FileOpenDialog(""File Rename"", ""F:\"", ""Images (*.jpg)|Videos (*.mp4)"", $FD_MULTISELECT, """", $hForm)

$aDirContent_New = StringSplit($FileSelect, ""|"", 2)

_ArrayDisplay($aDirContent_New)

    For $i = UBound($aDirContent_New) - 1 To 0 Step - 1
        ConsoleWrite($i & "" "" & $aDirContent_New[$i] & @CRLF)
        If StringRegExp($aDirContent_New[$i], ""^\d{4}(-\d{2}){2}_\d{6}_[PV]$"") Then
            ConsoleWrite(""> "" & $i & @CRLF)
            _ArrayDelete($aDirContent_New, $i)
            ContinueLoop
        EndIf
        ;$aDirContent_New[$i] = $aDirContent_New[0] & ""\"" & $aDirContent_New[$i]
    Next
    
_ArrayDisplay($aDirContent_New)
{{{


As I said, passing an array directly, or the following code works perfectly with regexp which leads me to believe this is a bug.



{{{
#include <File.au3>
#include <WinAPISysWin.au3>
Global $GText
Local $hTimerProc = DllCallbackRegister('_TimerProc', 'none', 'hwnd;uint;uint_ptr;dword')
Global $g_iCount = 0
Local $iTimerID = _WinAPI_SetTimer(0, 0, 1000, DllCallbackGetPtr($hTimerProc))
$title = ""File Rename""
$sFileSelect = FileOpenDialog($title, ""F:\"", ""Images (*.jpg)|Videos (*.mp4)"", $FD_MULTISELECT, """", 0)
$aDirContent_New = StringSplit($GText, """""""", 2)
_ArrayDisplay($aDirContent_New)

    For $i = UBound($aDirContent_New) - 1 To 0 Step - 1
        ConsoleWrite($i & "" "" & $aDirContent_New[$i] & @CRLF)
        If StringRegExp($aDirContent_New[$i], ""^\d{4}(-\d{2}){2}_\d{6}_[PV]$"") Or $aDirContent_New[$i] = "" "" Then
            ConsoleWrite(""> "" & $i & @CRLF)
            _ArrayDelete($aDirContent_New, $i)
            ContinueLoop
        EndIf
        ;$aDirContent_New[$i] = $aDirContent_New[0] & ""\"" & $aDirContent_New[$i]
    Next

_ArrayDisplay($aDirContent_New)
Func _TimerProc($hWnd, $iMsg, $iTimerID, $iTime)
$GText = ControlGetText($title, """", ""Edit1"")
EndFunc   ;==>_TimerProc
}}}
"	Bug	closed		AutoIt	3.3.14.5	None	No Bug		
