<div dir="ltr"><div>Ken,</div><div> </div><div>Thanks - that was VERY helpful - and your simplified version did the trick</div><div>Helps to know the 'stepology' for future edits, etc....I was close, given the fact that I didn't specify to allow spaces...but the screaming part you had right, until your explanation lol</div>
<div>thanks</div><div>Scott</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 31, 2013 at 11:52 AM, Kenneth Brody <span dir="ltr"><<a href="mailto:kenbrody@spamcop.net" target="_blank">kenbrody@spamcop.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 7/31/2013 10:21 AM, <a href="mailto:scooter6@gmail.com" target="_blank">scooter6@gmail.com</a> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
I'm trying to get our address fields to be more USPS compliant, so I want<br>
to 'remove' a comma or period if someone inputs them<br>
<br>
So far I have :<br>
<br>
{{A} | {N} | [!","!] | [!"."!]}<br>
<br>
In testing this edit, if I pust something like: 1234, it changes it<br>
to just: 1234 (perfect)<br>
If I put 1234 Main St, Apt A I get edit failed<br>
<br>
If I put 1234. (period) I get edit failed..... shouldn't I at least<br>
get the same result using the period, shouldn't it remove it like it does<br>
with 1234, (comma) ??<br>
<br>
How can I make the field NOT allow a comma or a period but can accept<br>
all letters and numbers<br>
</blockquote>
<br></div></div>
Two problems:<br>
<br>
(1) Your edit won't allow any imbedded spaces, so even "123 Main" would fail.<br>
<br>
(2) What about other punctuation? What do you want to do with things such as hyphens?<br>
<br>
Assuming you want only letters/numbers/spaces, and want to accept, but eliminate, commas and periods:<div class="im"><br>
<br>
{{A} | {N} | {" "} | !","! | !"."! }<br>
<br></div>
The addition of accepting spaces should be obvious as to how it works. However, the main change is replacing:<div class="im"><br>
<br>
[!","!] | [!"."!]<br>
<br></div>
with:<div class="im"><br>
<br>
!","! | !"."!<br>
<br></div>
This is crucial to getting the "remove periods" to work. You are probably asking "why?"<br>
<br>
Time to learn a little German and conduct a "gedankenexperiment" -- become the filePro edit engine...<br>
<br>
==========<br>
<br>
You are given the (slightly modified) original edit<div class="im"><br>
<br>
{{A} | {N} | {" "} | [!","!] | [!"."!]}<br>
<br></div>
and the input string<br>
<br>
123 Main, Apt. 17<br>
<br>
The initial character "1" does not pass the "A" edit, causing "{A}" to fail. The edit then tries "{N}", which accepts the "1" as well as the subsequent "2" and "3". However, the space fails, and the "{N}" ends, having accepted "123". The entire or-series has now succeeded, causing the edit engine to return to the outermost "{...}" pair.<br>
<br>
The next character, the space, fails "A" and "N", and is then accepted by the " " edit. Since the next character, "M", fails to pass the " " edit, the {" "} ends, the or-series succeeds, and control again returns to the outermost "{...}" pair.<br>
<br>
Repeat for "Main", which will be accepted by "{A}", stopping at the comma.<br>
<br>
The comma fails the A, N, and " " edits. It does, however, pass the next part of the edit -- [!","!] -- causing it to be deleted, and control again returning to the outermost "{...}".<br>
<br>
Repeat for " " and "Apt".<br>
<br>
Now, for the part as to why the above fails at the "."...<br>
<br>
We have the character ".". It fails A. It fails N. It fails " ". However, contrary to what you might expect, the period does, in fact, pass the next part of the edit -- [!","!]<br>
<br>
"How can a period possibly pass that edit?" I can hear you screaming.<br>
<br>
Simple -- the "accept or delete a comma" is *optional*. You have told filePro, "if there is a comma, delete it, but if there isn't a comma, that's okay too". The or-series is satisfied, and control once again returns to the outermost "{...}".<br>
<br>
The period never gets accepted, and it never gets deleted. Hence, the edit failure.<br>
<br>
By removing the "optional" part of the edit, you tell filePro that if there isn't a comma to delete, fail that part of the or-series, and continue on, at which point the accept-or-delete the period portion of the edit kicks in, deleting the period, satisfying the or-series and, as always, returns control to the outermost "{...}".<br>
<br>
At which point, the edit continues on to the " ", the "17", and the trailing spaces, as explained above. The entire field has now been accepted (with the appropriate characters deleted), and the edit has passed.<br>
<br>
<br>
==========<br>
<br>
Now, as to my question (2) above... What about other punctuation? For example, the hyphen and slash in:<br>
<br>
27-1/2 sixth st.<br>
<br>
Your edit will fail on anything that contains any punctuation other than commas and periods.<br>
<br>
If you want to accept everything *except* commas and periods, the edit can be simplified to:<br>
<br>
{ !","! | !"."! | * }<br>
<br>
You can then decide on specific characters you want to delete in addition to comma and period, and accept everything else as-is. For example:<br>
<br>
{ !","! | !"."! | !"?"! | * }<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Kenneth Brody<br>
</font></span></blockquote></div><br></div>