<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 &#39;stepology&#39; for future edits, etc....I was close, given the fact that I didn&#39;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">&lt;<a href="mailto:kenbrody@spamcop.net" target="_blank">kenbrody@spamcop.net</a>&gt;</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&#39;m trying to get our address fields to be more USPS compliant, so I want<br>
to &#39;remove&#39; a comma or period if someone inputs them<br>
<br>
So far I have :<br>
<br>
{{A} | {N} | [!&quot;,&quot;!] | [!&quot;.&quot;!]}<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&#39;t I at least<br>
get the same result using the period, shouldn&#39;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&#39;t allow any imbedded spaces, so even &quot;123 Main&quot; 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} | {&quot; &quot;} | !&quot;,&quot;! | !&quot;.&quot;! }<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>
    [!&quot;,&quot;!] | [!&quot;.&quot;!]<br>
<br></div>
with:<div class="im"><br>
<br>
    !&quot;,&quot;! | !&quot;.&quot;!<br>
<br></div>
This is crucial to getting the &quot;remove periods&quot; to work.  You are probably asking &quot;why?&quot;<br>
<br>
Time to learn a little German and conduct a &quot;gedankenexperiment&quot; -- become the filePro edit engine...<br>
<br>
==========<br>
<br>
You are given the (slightly modified) original edit<div class="im"><br>
<br>
    {{A} | {N} | {&quot; &quot;} | [!&quot;,&quot;!] | [!&quot;.&quot;!]}<br>
<br></div>
and the input string<br>
<br>
    123 Main, Apt. 17<br>
<br>
The initial character &quot;1&quot; does not pass the &quot;A&quot; edit, causing &quot;{A}&quot; to fail.  The edit then tries &quot;{N}&quot;, which accepts the &quot;1&quot; as well as the subsequent &quot;2&quot; and &quot;3&quot;.  However, the space fails, and the &quot;{N}&quot; ends, having accepted &quot;123&quot;.  The entire or-series has now succeeded, causing the edit engine to return to the outermost &quot;{...}&quot; pair.<br>

<br>
The next character, the space, fails &quot;A&quot; and &quot;N&quot;, and is then accepted by the &quot; &quot; edit.  Since the next character, &quot;M&quot;, fails to pass the &quot; &quot; edit, the {&quot; &quot;} ends, the or-series succeeds, and control again returns to the outermost &quot;{...}&quot; pair.<br>

<br>
Repeat for &quot;Main&quot;, which will be accepted by &quot;{A}&quot;, stopping at the comma.<br>
<br>
The comma fails the A, N, and &quot; &quot; edits.  It does, however, pass the next part of the edit -- [!&quot;,&quot;!] -- causing it to be deleted, and control again returning to the outermost &quot;{...}&quot;.<br>
<br>
Repeat for &quot; &quot; and &quot;Apt&quot;.<br>
<br>
Now, for the part as to why the above fails at the &quot;.&quot;...<br>
<br>
We have the character &quot;.&quot;.  It fails A.  It fails N.  It fails &quot; &quot;. However, contrary to what you might expect, the period does, in fact, pass the next part of the edit -- [!&quot;,&quot;!]<br>
<br>
&quot;How can a period possibly pass that edit?&quot; I can hear you screaming.<br>
<br>
Simple -- the &quot;accept or delete a comma&quot; is *optional*.  You have told filePro, &quot;if there is a comma, delete it, but if there isn&#39;t a comma, that&#39;s okay too&quot;.  The or-series is satisfied, and control once again returns to the outermost &quot;{...}&quot;.<br>

<br>
The period never gets accepted, and it never gets deleted.  Hence, the edit failure.<br>
<br>
By removing the &quot;optional&quot; part of the edit, you tell filePro that if there isn&#39;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 &quot;{...}&quot;.<br>

<br>
At which point, the edit continues on to the &quot; &quot;, the &quot;17&quot;, 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>
    { !&quot;,&quot;! | !&quot;.&quot;! | * }<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>
    { !&quot;,&quot;! | !&quot;.&quot;! | !&quot;?&quot;! | * }<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Kenneth Brody<br>
</font></span></blockquote></div><br></div>