Created
September 28, 2020 11:38
-
-
Save OlegBezverhii/7019f125e053699a83d05b0248157911 to your computer and use it in GitHub Desktop.
Регулярные выражения для Excel для приведение типа томов архива Транснефть к нормальному виду
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function RegExpExtract(Text As String, Optional Item As Integer = 1) As String | |
On Error GoTo ErrHandl | |
Set regex = CreateObject("VBScript.RegExp") | |
regex.Pattern = "Г\.0\.0000\.0002-И-ЦУП ВСТО\/ГТП-27\.\d\d\d\-.{1,4}" | |
regex.Global = True | |
If regex.Test(Text) Then | |
Set matches = regex.Execute(Text) | |
RegExpExtract = matches.Item(Item - 1) | |
Exit Function | |
End If | |
ErrHandl: | |
RegExpExtract = CVErr(xlErrValue) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment