Is it possible to match only capital letters in Text explorer's customize regex patterns?
I am trying to match only initials which are typically 3 to four letter capitals.
Thanks for your reply
I think this will only work if the sentence ends with the capitals and you need the capitalized term.
The solutions I ended up with was to remove all capitalized terms with the following formula:
Regex( :Text, "(?:\b[A-Z]{3,4}\b)", "", GLOBALREPLACE )
It basically works as a search-replace with the GLOBALREPLACE option.
I tried to do this in Text Explorer, but the platform on its own lower cases all the text, as you note. As an aside, this should probably be optional.
But, a workaround might help.
I started with the aircraft incidents sample table and focused on the Location column.
Added a text column (put it next to location for ease, but doesn't have to be there). Under the column properties, I chose formula to create the following formula: Regex( :Location, "([A-Z]{2,4}$)", "\1" ).
This formula uses a regular expression on the location column looking for capital letters [A-Z] between 2 and 4 characters {2,4} in length, and at the end of value ($). It returns the first capture buffer (\1) as the value of the formula.
As another aside - I like to create my formulas in a text editor and copy and paste from there - can't do that in the formula editor - something else I'd like to see implemented.
Regular expressions are or can be complex - a virtual language onto themselves - the subject of a number of books and any number of websites, so this explanation is necessarily brief and done with the intention of you modifying to fit your needs.
Hope this helps, and if you have any questions, please ask.
RCW
I might have found the answer myself, as the manual says step 1 is to convert everything to lowercase...
Would it be a problem to change that to step 2?