View Single Post
Old 05-02-2012, 02:33 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
When operating on columns such as "tags" that contain multiple items, the search/replace operation is applied to every item, item by item. The search is not a selector. Instead the text matched by the search regexp is replaced by the "replace" expression. Your expression says to modify only tags beginning with "Accolade.". All other tags are passed through unmodified.

The way to get what you want is to have the S/R modify every tag, removing some or all of the text. All text is removed if the tag does not begin with the desired word (e.g., "Accolade"), otherwise the desired word is removed leaving what follows. For example, the search expression
Code:
^((?!Accolade\.).*$)|(Accolade\.)
when used with a null replacement expression will remove the tag completely if it does not begin with "Accolade.", or remove the word "Accolade." leaving whatever follows. The expression
Code:
^Accolade\..*$
will remove all tags that begin with "Accolade.".
chaley is offline   Reply With Quote