Why does this not work for the User Agent empty string?
<cfif REFindNoCase("^$", CGI.HTTP_USER_AGENT)>
<cfoutput>
"#CGI.HTTP_USER_AGENT#"
</cfoutput>
</cfif>
For obvious reasons this works as an alternative.
<cfif ! len(CGI.HTTP_USER_AGENT)>
<cfoutput>
"#CGI.HTTP_USER_AGENT#"
</cfoutput>
</cfif>
However, I'm not really interested in a workaround but the reason why the firt RegEx approach fails.
Testing conducted with FF Add-On "User Agent Switcher" I'm able to impersonate a browser that is void of a UA.
Other info:
Adobe ColdFusion 9.0.1
Server 2008 R2 64 bit
Testing code from within application.cfm