In a field where I enter info about author names, I need an input mask which in RegEx could be translated as :
[.](([a-zA-Z])*([,])([a-zA-Z])*)*[.]
Or
([.])(([a-zA-Z])*([,])([a-zA-Z])*)*([.])
(that's a pretty common syntax I believe -- used in Java, Perl...)
Basically, it'd allow me to enter a succession of
.Name,First name,Name,First Name.
With periods around the string.
It wouldn't allow any numbers or other characters.
for fun, It tried the [.](([a-zA-Z])*([,])([a-zA-Z])*)*[.] in the input mask text box, but it doesn't work.
It could be that it can't do that, or it could be there are elements of the syntax (VB regex ?) I just don't know.
I'd appreciate any help or feedback on that one.
Thanks !
[Edit : of course, I read the page on input masks...]
Comments
Function TypeDocBibCont (TagField, TypeDocBib)
Dim re, objMatch, colMatches, sMsg, x
sMsg = TypeDocBib
Set re = New RegExp
re.Global = True
re.Pattern = "([x][a-zA-Z]*[-])"
s = TagField
Set colMatches = re.Execute(s)
For Each objMatch In colMatches
x = objMatch.Value
If InStr(TypeDocBib,x)=0 Then
sMsg = sMsg & x
Else
sMsg = sMsg
End If
Next
TypeDocBibCont2 = sMsg
End Function
"
([x][a-zA-Z]*[-])
"
and returns all of these, concatenated in a nice string... :) and I send it to another field.