im getting this userAgent string
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3)"
i want a regullar string like this
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
my ie.browser is looking like this
<browsers>
<browser id="IE" parentID="Mozilla">
<identification>
<userAgent match="MSIE (?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" />
<userAgent nonMatch="IEMobile" />
</identification>
<capture>
<userAgent match="Trident/(?'layoutVersion'\d+)" />
</capture>
<capabilities>
<capability name="browser" value="IE" />
<capability name="layoutEngine" value="Trident" />
<capability name="layoutEngineVersion" value="${layoutVersion}" />
<capability name="extra" value="${extra}" />
<capability name="isColor" value="true" />
<capability name="letters" value="${letters}" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="screenBitDepth" value="8" />
<capability name="type" value="IE${major}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
<!-- Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4325) -->
<browser id="IE6Plus" parentID="IE">
<identification>
<capability name="majorversion" match="^[6-9]|\d{2,}$" />
</identification>
<capabilities>
<capability name="jscriptversion" value="5.6" />
<capability name="msdomversion" value="${majorversion}.${minorversion}" />
<capability name="ExchangeOmaSupported" value="true" />
<capability name="activexcontrols" value="true" />
<capability name="backgroundsounds" value="true" />
<capability name="javaapplets" value="true" />
<capability name="supportsVCard" value="true" />
<capability name="supportsAccessKeyAttribute" value="true" />
<capability name="vbscript" value="true" />
</capabilities>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) -->
<browser id="IE6to9" parentID="IE6Plus">
<identification>
<capability name="majorversion" match="^[6-9]$" />
</identification>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) -->
<browser id="IE7" parentID="IE6to9">
<identification>
<capability name="majorversion" match="^7$" />
</identification>
<capabilities>
<capability name="jscriptversion" value="5.7" />
</capabilities>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) -->
<browser id="IE8" parentID="IE6to9">
<identification>
<capability name="majorversion" match="^8$" />
</identification>
<capabilities>
<capability name="jscriptversion" value="6.0" />
</capabilities>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) -->
<browser id="IE9" parentID="IE6to9">
<identification>
<capability name="majorversion" match="^9$" />
</identification>
<capabilities>
<capability name="jscriptversion" value="6.0" />
</capabilities>
</browser>
<!-- Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) -->
<browser id="IE10Plus" parentID="IE6Plus">
<identification>
<capability name="majorversion" match="\d{2,}" />
</identification>
<capabilities>
<capability name="jscriptversion" value="6.0" />
</capabilities>
</browser>
<browser id="InternetExplorer" parentID="Mozilla">
<identification>
<userAgent match="Trident/(?'layoutVersion'[7-9]|0*[1-9]\d+)(\.\d+)?;(.*;)?\s*rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)))" />
<userAgent nonMatch="IEMobile" />
<userAgent nonMatch="MSIE " />
</identification>
<capabilities>
<capability name="browser" value="InternetExplorer" />
<capability name="version" value="${version}" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="layoutEngine" value="Trident" />
<capability name="layoutEngineVersion" value="${layoutVersion}" />
<capability name="type" value="InternetExplorer${major}" />
</capabilities>
</browser>
<gateway id="IEbeta" parentID="IE">
<identification>
<capability name="letters" match="^([bB]|ab)" />
</identification>
<capture>
</capture>
<capabilities>
<capability name="beta" value="true" />
</capabilities>
</gateway>
</browsers>
how can i change the identification tag so i could get a normal string without to much values like all the parameters
Aucun commentaire:
Enregistrer un commentaire