View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bhupinder Rayat
 
Posts: n/a
Default Searching for codes in text strings

Hi All,

I have text similar to the following, which is an in-house language.
----------------------------------------------
field b831 B831 write AASLQ0300000l;

PCPACIMTAAABl [B29 ]

field B7 b7 ;
field a8 @latestdate("PCP2EHSEAAAAh", jEnd);
field b8 @if(a8 <jStart, @latest("PCP2EHSEAAAAh", jEnd),
@avg("PCP2EHSEAAAAh", jStart, jEnd));
--------------------------------------------------------

I want to look through this text and copy out any 13 character codes that
are present (e.g. "PCPACIMTAAABl" ,2 "PCP2EHSEAAAAh").

These codes all share the following characteristics,

1) they are all 13 characters in length
2) the last character in the code is always either a "l", "h" or a "c".
3) they contrain no spaces
4) the first 12 characters are always in CAPS (followed by a lower "l", "h"
or a "c".

Any help at all will be much appreciated. If you need more explanation,
please ask and I will be happily explain things further.

Regards,

Bhupinder.