29\.0?2\.(1904|1908|1912|1916|1920|1924|1928|1932|1936|1940|1944|1948|1952|1956|1960|1964|1968|1972|1976|1980|1984|1988|1992|1996|2000|2004|2008|2012|2016|2020|2024|2028|2032|2036|2040|2044|2048|2052|2056|2060|2064|2068|2072|2076|2080|2084|2088|2092|2096)
function test_f(){
let s;
s = "123 check";
console.log(`${s} --> ${f(s," ")}`)
s = "ok check";
console.log(`${s} --> ${f(s)}`)
s = "россия, москва";
console.log(`${s} --> ${f(s)}`)
s = "россия москва";
console.log(`${s} --> ${f(s)}`)
s = "привет хабр, вопрос";
console.log(`${s} --> ${f(s)}`)
s = "привет хабр";
};
f = function(s, delimiter){
delimiter = delimiter || ",";
let a = (s+"").split(delimiter).map(x=>x.trim());
return (a.length<=1)?null:a;
};
А, В, Е, К, М, Н, О, Р, С, Т, У и Х
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]\s*\d{3}\s*[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{2,3})|([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{3}\s*\d{2,3})
Public Function RegExpExtract(sText As Variant, Pattern As String) As Variant
On Error GoTo ErrHandl
Text = CStr(sText)
Dim regex As New RegExp ' создаем экземпляр RegExp
regex.Pattern = Pattern
regex.Global = False
If regex.test(Text) Then
Set matches = regex.Execute(Text)
RegExpExtract = matches.Item(0).SubMatches(0)
Exit Function
End If
ErrHandl:
RegExpExtract = ""
'RegExpExtract = "#" & err.Number & "> " & err.Description
End Function