![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VBScript RegEx vs ECMA 262 I had read that Microsoft VBScript Regular Expressions 5.5 conformed to ECMA-262 with some exceptions in the replacement text. In using VBA 6.5 (under Excel 2007), it appears that <nbsp> (Hex code A0) is not included in the "white space" character class. Is this another area of non-conformance with ECMA-262? Or is there something wrong with my setup. And yes, I am aware that the MS web site documentation indicates that \s is equivalent to [ \f\n\r\t\v] which clearly does not include <nbsp> in that class. But I just wanted to confirm that what others have written is in error (or that I am doing something wrong). Here is VBA code that demonstrates this: ================================== Option Explicit Sub TestNBSP() Dim NBSP As String Dim oRE As RegExp Const sPat1 As String = "\xA0" Const sPat2 As String = "\s" Const sPat3 As String = "\S" NBSP = Chr(160) Set oRE = New RegExp oRE.Pattern = sPat1 Debug.Print oRE.Pattern, oRE.Test(NBSP) oRE.Pattern = sPat2 Debug.Print oRE.Pattern, oRE.Test(NBSP) oRE.Pattern = sPat3 Debug.Print oRE.Pattern, oRE.Test(NBSP) End Sub ===================================== Immediate window: \xA0 True \s False \S True ------------------------------------ --ron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Regex help please? | PowerShell | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| regex help | PowerShell | |||
| regex | PowerShell | |||
| Ecma International Approves Office Open XML as Worldwide Industry Standard | Vista News | |||