Submitted by Armando on 2010/02/22 20:40
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

I was going to try another solution using the Pop-up list feature.
 
But :
 
1- it won't work for certain signs. Here's what I'd like to display in one of my pop-up list :
,,in  ,,|. , .|
 
... and nothing shows up in my list. I didn't really expect that to work, as these are punctuations marks... But it would be good if it could in a way or another.
 
 
2- The list is only accessible if I use the mouse.
It would be good if repeating F2 showed the list (like for dates and the little calendar)

Quickly looking at 4.035 in the manual, it looks like   \.????\,????\,????\,????\. will work.
(adjust the number of question marks for the length of each name).
 
 
 
 

Armando

2010/02/24 23:17

In reply to by KeithB

[quote=KeithB]
Quickly looking at 4.035 in the manual, it looks like   \.????\,????\,????\,????\. will work.
(adjust the number of question marks for the length of each name). 
[/quote]
 
Thanks Keith. (...Was starting to feel a bit lonely here... ;) )
 
Yes, but this doesn't really allow what I'm after.
You see, with Regular Expressions, I wouldn't have to define a certain amount of characters between each ",".
 
The "\.????\," etc. pattern is not possible nor convenient with for what I need. Names can have different lengths, there can be more than 2 names, etc.
 
I really need Regular expressions (regexes) here (see my example in first post).
VB has them and that's why I was wondering if I could use their magic (in one way or another) in masks.

Pierre ? Where are you ?
There are a few bugs and posts floating around.
 
On a different note...
 
I tried something on a different field and a similar strategy could be used to filter out unwanted characters in a field :
 
 
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
 
What this does is that it find all patterns corresponding to the and regex "([x][a-zA-Z]*[-])" and returns all of these, concatenated in a nice string... :) and I send it to another field.
 
Of course, the same logic could be used for different things.
 
vbs functions like that allow one to use Regex to filter whatever field one wants to filter... and send the result anywhere. And circumvent "masks" limitations.

Pierre_Admin

2010/03/09 14:11

In reply to by Armando

>Pierre ? Where are you ?
 
On holidays... and sick . Feeling better now.
 
Thanks for your work on this issue Armando. Editing directly in the grid is under grid control, and it does not support regex. Of course, I could process it after editing is complete.