![]() |
#1 |
Connoisseur
![]() Posts: 66
Karma: 79
Join Date: Sep 2006
Location: Fairfax, Va
Device: PRS-500, PRS-505, PRS-650, ipod Touch, ipad 2, NC, Kindle Scribe
|
Using Find/Replace with BD
I love using BD, but am having trouble using its find/replace function. I have a document that is riddled with bracket enclosed numbers that I'd like to remove. Things like [1], [23], [245] etc. I can't seem to figure out how to use any type of wildcards within the brackets for BD to match on. I've tried reading the built-in tutorial on regexp, but yikes...waaay over my head.
![]() Anyone know of a straightforward way to do this just using BD? Many thanks in advance! |
![]() |
![]() |
![]() |
#2 |
Retired & reading more!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,764
Karma: 1884247
Join Date: Sep 2006
Location: North Alabama, USA
Device: Kindle 1, iPad Air 2, iPhone 6S+, Kobo Aura One
|
I don't know either but would sure be interested in the answer. The way I handled this problem before was to export to MS Word where I knew how to use wildcards. It worked but it would be much easier if I could have done it in BD.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,249
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
if you hit f2, that brings up the search/replace dialog and you can search/replace on a RegExp. I don't have the code handy, but I have done it before and it has worked for me.
|
![]() |
![]() |
![]() |
#4 |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Try this regular expression
\[[0-9]*\] Or try this one: \[[0-9]+\] |
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() Posts: 66
Karma: 79
Join Date: Sep 2006
Location: Fairfax, Va
Device: PRS-500, PRS-505, PRS-650, ipod Touch, ipad 2, NC, Kindle Scribe
|
Awesome, Nate...Nate the Great indeed.
![]() Thanks a ton! |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Retired & reading more!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,764
Karma: 1884247
Join Date: Sep 2006
Location: North Alabama, USA
Device: Kindle 1, iPad Air 2, iPhone 6S+, Kobo Aura One
|
|
![]() |
![]() |
![]() |
#7 |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
You are both welcome.
![]() I happened to have a lex & yacc textbook next to me so I looked it up. BTW, the '*' and '+' give slightly different results because '*' matches zero or more characters inside the brackets, and '+' matches one or more characters inside the brackets. [a-z] [A-Z] [0-9] [ ] Each of the preceding is a variation of "match one of what's inside the brackets". They respectively mean look for only lowercase, uppercase, digits, and spaces. Note that the last one is not empty; it has a space in it. Also they can be combined. [0-9a-zA-Z] Please note the lack of spaces. _{a,b} Match what is immediately before the brackets no less than a, no more than b. _? Match zero or one occurrences of what's immediately before the '?'. Very useful for matching negative and positive numbers. \_ Match whatever follows the '\' literally. "match what is in between the quotes literally" All of the above can be combined, but be careful. That is most of what you will need for BD. Warning: I have not tested all of it in BD. But it is standard UNIX stuff from the textbook. It should work. Last edited by Nate the great; 10-11-2007 at 10:56 PM. |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 31
Karma: 44
Join Date: Feb 2009
Device: none
|
yeah use regexes, definitely the best way.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with Word - Find & Replace | Big Kev | Workshop | 3 | 09-21-2010 06:51 PM |
REGEX find and replace help please | potestus | Sigil | 13 | 09-18-2010 04:14 PM |
find and replace, epub | ampsonic | Reading and Management | 3 | 03-02-2010 03:20 AM |
Find/Replace with regular expression | hydrolith | Sigil | 6 | 03-01-2010 08:42 PM |
Crashes on find / replace all | mr ploppy | Sigil | 1 | 02-03-2010 12:35 PM |