![]() |
#1
|
||||
|
||||
![]()
Does any one know if it's possible to use Regular expression in VBA?
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#2
|
||||
|
||||
![]()
Yes, you can. Here is an example:
Code:
Public Sub TestRegEx() Dim regEx As Object Dim matches As Object Dim match As Variant Set regEx = CreateObject("VBScript.RegExp") regEx.Global = True regEx.Pattern = "\d{3}-\d{2}-\d{2}" 'Match a phone number Set matches = regEx.Execute("Phone numbers: 555-12-34, 555-56-78.") For Each match In matches Debug.Print "Match Found: " & match Next End Sub I hope this helps. |
#3
|
||||
|
||||
![]()
Thanks Alex. This is awesome.
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|