Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 10-20-2012, 04:37 PM   #1
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Question Is the "Regex Builder" working??

Hola!

I am trying to test some new regex expressions using the "Regex Builder", but either I am way off base on how to use it or it is not working!

I can enter and save search/replace regexes ok, and they do (well, MOST do, LoL) work; it is the ones that don't work that I need to test in the Regex Builder page. I can make the regexes work in OOO Writer, for example, using a HTML document and its search & replace function. But, that doesn't mean the same code will actually work in Calibre, so need to use the Builder!

Procedure:

1. Open the Search & Replace menu/setup.
2. Put my regex into the "Search Regular Expression" (SRE) field
3. Select "Add", just in case, LoL.
4. Bring the added regex back to the SRE field
5. Select the "Wizard" button to the right of the SRE field
6. The "Regex Builder" window opens, with my regex in the "Regex:" field at the top
7. But, the "Preview" window is blank, and pressing the "Test" button does nothing
8. So, at the bottom there is a "Open" button, which presumably lets you open a document(?) that contains the data one is trying to search and replace
9. So, select the EPUB document and try to open it. Nothing, no document. Try a .html document. Nothing shows in the "Preview" page! Neither will it let me PASTE any text in it.

So, either I totally misunderstand how to use this feature or it is broken.

Somebody set me straight, please!

Monty
MontyJ is offline   Reply With Quote
Old 10-20-2012, 09:14 PM   #2
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
Without an example of the regex and the text attempting to match there is no way to help. *calibre 0.9.3, works fine for me.*

Edit:
I would assume you have reviewed: An introduction to regular expressions.
Gunnerp245 is offline   Reply With Quote
Advert
Old 10-20-2012, 10:06 PM   #3
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Gunner,

I was not looking for specific regex 'code' help as much as why the "Wizard" window will not show ANY text with which to test a regex.

But, fyi, here is a code (from Kovid) that works, but when I try to use it in the "Wizard", I still do not get any text in the wizard preview window:

Code:
<b.*?>\s*Generated\s+by\s+ABC\s+Amber\s+LIT.*?</b>
The code I am testing (of several) is this:

Code:
<b>.*?</b>

to search within this line of text:

<P><A HREF="http://www.abbyy.com/buy"><B>Y</B></A></P>

to find the letter "Y" or any other text between the b tags

I do not claim it is a 'good code', of course, just that as a test it should work, and something should show up in the wizard preview window I can use as a test. It doesn't.

I am using W7 x64 with all the latest updates, java, and flash installed, so am puzzled why others say the wizard preview window works and mine doesn't...

Thanks
MontyJ is offline   Reply With Quote
Old 10-21-2012, 08:49 AM   #4
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
Lightbulb Search & Replace: Preferences vs. Convert

It seems you are opening "Search and Replace" from the preference menu, as there is no 'open' button in the convert menu.

Quote:
Procedure:
1. Open the Search & Replace menu/setup.
2. Put my regex into the "Search Regular Expression" (SRE) field
3. Select "Add", just in case, LoL.
4. Bring the added regex back to the SRE field
5. Select the "Wizard" button to the right of the SRE field
6. The "Regex Builder" window opens, with my regex in the "Regex:" field at the top
7. But, the "Preview" window is blank, and pressing the "Test" button does nothing
8. So, at the bottom there is a "Open" button, which presumably lets you open a document(?) that contains the data one is trying to search and replace
9. So, select the EPUB document and try to open it. Nothing, no document. Try a .html document. Nothing shows in the "Preview" page! Neither will it let me PASTE any text in it.
The Preferences action allows you to change the way various aspects of calibre work on every file every time. To see what you are trying to do you need to be in the convert menu.

Spoiler:
Main calibre Menu, Book to convert selected.

Spoiler:
After selecting 'convert book'.

Spoiler:
Selected 'Search and Replace'.

Spoiler:
Selected 'Wizard' icon.


calibre online User Manual.
Gunnerp245 is offline   Reply With Quote
Old 10-21-2012, 10:10 AM   #5
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Thanks...That did it!!

No where had I read that it COULDN'T be done from the Preferences menu..all the controls were there, not greyed out or anything!!

Now I can run my stupid little tests..

Thanks again

Monty
MontyJ is offline   Reply With Quote
Advert
Old 10-23-2012, 08:36 AM   #6
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
Quote:
Originally Posted by MontyJ View Post
No where had I read that it COULDN'T be done from the Preferences menu..all the controls were there, not greyed out or anything!!
Preferences is where your select/declare settings that will apply to every file, every time. There was no file to see when selecting the wizard icon as there was no file open for it to display.
Gunnerp245 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Regex "FN LN" to "LN, FN" & reverse? unboggling Library Management 19 11-20-2013 06:44 AM
Problem with "Add Books" regex wygit Library Management 9 07-24-2011 12:24 PM
Do you use "Builder Worlds" in your writing? Steven Lake Writers' Corner 22 10-04-2010 07:07 PM
An explanation for the "Oops, We're Working On Your problem," page at the Sony Store Dr. Drib Sony Reader 2 07-25-2009 07:40 AM


All times are GMT -4. The time now is 06:42 AM.


MobileRead.com is a privately owned, operated and funded community.