|05-01-2012, 10:02 PM||#1|
Join Date: Jan 2009
Location: South Pacific
Device: Kindle DX
Regex to selectively grab individual tags?
I've got some hierarchical tags that I'd like to "move" to a custom column so I can easily use them to make collections on my PRS-T1. There is a lot of this management that I want to to do so I'm hoping to use the Search&Replace dialog to do it.
I expected that something like "Accolade\.(.*)" in the regex field would let me extract the information I want but it seems to grab the rest of the tags as well. What am I missing to get from this:
Places.Africa, Imperialism, Accolade.100 best.Radcliffe's, Accolade.100 best.Some Prize.1958, Accolade.100 best.Modern Library, Trading posts, Degeneration, People.Europeans
to this and this:
100 best.Radcliffe's, 100 best.Modern Library Readers, 100 best.Modern Library, Trading posts
Places.Africa, Imperialism, Trading posts, Degeneration, People.Europeans
|05-02-2012, 03:33 AM||#2|
"chaley", not "charley"
Join Date: Jan 2010
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
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
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Help to compose a regex to find strings, enclosed in comments tags||Vadim777||Conversion||5||04-17-2012 01:49 PM|
|Regex help needed, selecting single tags out of namy||Sidetrack||Library Management||5||02-26-2012 11:54 PM|
|Exporting based on individual tags||BookJunkieLI||Library Management||7||02-22-2012 05:18 PM|
|Amazon Tags - Popular tags vs Unique tags.||chrisanthropic||Writers' Corner||6||09-20-2011 12:18 AM|
|Google Allows Carriers to Selectively Block Tethering Apps From Android Market||RockdaMan||Android Devices||16||05-14-2011 08:19 PM|