Lupp wrote:To serch for a literal "GB"
probably preceded by one space and everything surely prefixed by an opening parenthese you need to use "\( ?GB" as the RegEx to search for. There the "\(" acts as a literal "(" and the " ?" for exactly one space or none at all.
You may want to replace this simply by "(GB)", this way closing the pair of parentheses and at the same time getting rid of the superfluous space (if any). (If you want to keep the optional space, please ask again.)
However, if there also can occur already complete "(GB)" the above proceding would result in a doubled closing parenthese "(GB))". To avoid this you would have to use a slightly more complicated RegEx. The concept of "wildcards" as used in MS software is by far too primitive (weak) to help this far.
Please attach a relevant and sufficiently rich collection of examples as an .odt or a .ods file here.
See attached example.
aoo97916SpecialFandR_1.ods
This can, of course, only work if the texts to procede ar constant texts, not formula results.
Perhaps I have not been clear enough so I shall try again.
I have a list of horse names. After the end of each horse's name, there is a space. Then there is an open parenthesis, then a country code of 2 or 3 letters and then a closing parenthesis. There are no spaces between the open parenthesis, the country code and the closing parenthesis.
The only horse names I want to work on are those with a country code of (GB) appended to their name.
So, example: Flying Star (GB)
Because of the result of a previous and incorrect formula, some of these horse names have the closing parenthesis missing -
e.g. Flying Star (GB
All I wanted to do is add the closing parenthesis, but only for those horse names that have it missing.
RoryOF provided the solution and is seems to have worked. But I just want to check that none of these names have (GB left at the end, instead of (GB). This is all I need now.
Apache OpenOffice 4.1.6 AOO416m1(Build:9790) - Rev. 1844436
Mac OS X 10.13.6 (High Sierra) 32GB RAM
Saying "Never say never" says it.