View Single Post
Old 05-07-2020, 10:14 AM   #6
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by yamusing View Post
I've tried using regex search for "(weight:.+)" replace with "{\1}". I got this:

"5-glass apple group:95#TR4 Hefine94 {weight:140lbs (acc)} Z97-A.5"
"case:AR5steel group:Fractal-group heavy T*m5% {weight:@eightySix'Kilos}"
"case:AR5steel dark group:R3.R4.R5 group:Fractal-group"

How do I make the search and replace capture everything in the "{}" then move only that not including the parentheses to another field? Then removing the text within "{ }" and parentheses itself in the tag column?
The easiest way to do this is to use template as the source. That makes it easier to delete text across tag boundaries.

To copy the text to a new column:
Code:
Source: template
Template: {tags}
Search for: ^.*, (weight:.+), .*$
Replace with: \1
Destination: whatever the name of your column is
To delete the text from tags:
Code:
Source: template
Template: {tags}
Search for: ^(.*), weight:.+(, .*)$
Replace with: \1\2
Destination: tags
BTW: your input examples in the first post do not contain {} characters
chaley is offline   Reply With Quote