tracker issue : CF-4150938

select a category, or use search below
(searches all categories and all time range)
Title:

isValid Regex Incorrectly Validates

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Matthew Clemente / Matthew Clemente (Matthew Clemente)

Created: 05/10/2016

Components: Language, Functions

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final / CF 2016 HF3

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description: When using isValid, with regex, to validate a string, the result returned is incorrect (and differs from what is returned by refind(), which works as expected).

Steps to Reproduce:

<cfscript>
regex = '^[\w_]+[\w_ ]*[\w_]+$';

validString = 'test test';
invalidString = 'test ';

//should fail
writeoutput('Expected output is "NO", but result is ' & isValid( 'regex', invalidString, regex ) & '<br />');

//should pass
writeoutput('Works as expected: ' & isValid( 'regex', validString, regex ) & '<br />');

//refind, for reference:

//works as expected (shouldn't be found)
writedump(refind(regex,invalidString));

//works as expected (should be found)
writedump(refind(regex,validString));
</cfscript>

(http://trycf.com/gist/89dc09bf1238b831780c465113a1208c/acf11?theme=monokai)

Actual Result: NO

Expected Result: TRUE

Any Workarounds: Use some other regex search within CF

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4150938

External Customer Info:
External Company:  
External Customer Name: Matthew Clemente
External Customer Email:  
External Test Config: My Hardware and Environment details:



Version	11,0,07,296330

Tomcat Version	7.0.64.0

Edition	Developer 

Operating System	Windows Server 2012 R2 

OS Version	6.3 

Update Level	C:/ColdFusion11/cfusion/lib/updates/hf1100-3929327.jar 

Adobe Driver Version	5.1.3 (Build 000094) 

Java Version: 1.8.0_66

Attachments:

Comments: