Extract text plus "n" characters or date on partial match
On 22 Mar 2007 08:51:24 -0700, "FabZ" wrote:
.Pattern = sDateAdopt
If oRegExp.test(c.Text) = True Then i = 11 'column K
i = 11 it uses column B (1) to paste text and anyway it fail to
recognize many dates, apparently not different from the other one,
recognized.
Better with first version of sDateAdopt and sDateReent.
Now I will check further your sub looking for what's wrong.
Thanks again.
FabZ
I have written that the date MUST be at the end of the string, the way this is
set up. Also, "adopt" or one of your variations MUST be in the string (or one
of the reenter variations) or a date will NOT be extracted.
So, in your 2nd example, the date will not be extracted because there is no
"adopt" or "reenter". If you want the date extracted under those
circumstances, you need to tell where you want it extracted.
Also, if the date is not at the end of the string, or there are <space's
within the date, nonsense may be extracted. If such is the case, you need to
be very specific as to what you want.
For example: adopt (or one of your variations) followed by
<space followed by
8 characters with no <space
followed by a <space or the <end of the string.
All this can be done; even checking, for example, that the date is of a certain
format (e.g. 2 digits followed by a dot or slash followed by 2 digits followed
by a dot or slash followed by 2 or 4 digits). But again, you need to specify
this.
Perhaps if you post a few of the strings where the date is not getting
extracted, I can see where your specifications differ from what is in the
string.
--ron
|