0

My string is " 1.1" which has one tab key at the front and I use the regular expression pattern ^\t to find it.

But I failed. So what is the VBA regular expression for the tab key?

GSerg
  • 76,472
  • 17
  • 159
  • 346
Yubi Fu
  • 1
  • 1
  • There is no VBA regular expressions. You have to use the syntax of whatever regex library you are using. E.g. `^\t` would be correct for [Microsoft VBScript Regular Expressions](https://stackoverflow.com/q/22542834/11683). – GSerg Jan 18 '19 at 09:15
  • Are you sure tab is your only problem? The dot, if unescaped, will cause you trouble as well – Sam Jan 18 '19 at 10:28

2 Answers2

0

The regex for this would be (specifically for 1.1) :

^[\t]1\.1

That said, it would be nice to see how you're implementing it in your VBA because, as GSerg says, VBA does not have native regex.

visualnotsobasic
  • 428
  • 3
  • 17
-1

If you want to put a tab character before the "1.1" in your string you use Char(9) & "1.1"

If you want to find it, it may work. You would also like to try with vbTab

Thryn
  • 425
  • 2
  • 14