Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 01-10-2011, 08:42 AM   #76
flamelily
Junior Member
flamelily began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2011
Device: none
Quote:
Originally Posted by itimpi View Post
An easier way to do this is to use '\d*' to match a number of any length. Another useful one along these lines is '\s*' to match any number of white space characters.
oh thats perfect - \d* worked! MANY thanks
flamelily is offline  
Old 05-09-2011, 12:57 AM   #77
drone207A
Junior Member
drone207A began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Location: Yokohama, Japan
Device: Kindle 3
Having trouble with Regular Expressions

can anybody help me,
Im trying to get rid of "Book tittle (1975)"
The book title part is no problem... but the (1975) is killing me.
Maybe I'm missing something, but when I add that to the Regex, it highlights the 1975 but not the brackets.
Is there anyway of getting rid of all "(1975)" without affecting other numbers throughout the book?

Any help would be appreciated.
drone207A is offline  
Advert
Old 05-09-2011, 02:03 AM   #78
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Did you escape the bracket characters by preceding them with a backslash character? Unescaped brackets are used for grouping within regex.
itimpi is offline  
Old 05-09-2011, 02:08 AM   #79
drone207A
Junior Member
drone207A began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Location: Yokohama, Japan
Device: Kindle 3
Quote:
Originally Posted by itimpi View Post
Did you escape the bracket characters by preceding them with a backslash character? Unescaped brackets are used for grouping within regex.
EDITSorry I dont really understand what you mean
Could you please give me an example?


OK I worked it out.. thanks for your help!

Last edited by drone207A; 05-09-2011 at 02:38 AM. Reason: worked out problem
drone207A is offline  
Old 05-09-2011, 02:27 AM   #80
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
\(1975\)

That technique is required for any characters that have special meaning in regex syntax where you want the actual character. It is required for many of the non-alphanumeric characters (punctuation).

Last edited by itimpi; 05-09-2011 at 02:34 AM.
itimpi is offline  
Advert
Old 05-09-2011, 02:39 AM   #81
drone207A
Junior Member
drone207A began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Location: Yokohama, Japan
Device: Kindle 3
Quote:
Originally Posted by itimpi View Post
\(1975\)

That technique is required for any characters that have special meaning in regex syntax where you want the actual character. It is required for many of the non-alphanumeric characters (punctuation).
Oh I was late posting this by minutes!

Thanks again..
drone207A is offline  
Old 05-10-2011, 07:42 PM   #82
hrynkiw
Connoisseur
hrynkiw doesn't litterhrynkiw doesn't litter
 
hrynkiw's Avatar
 
Posts: 74
Karma: 154
Join Date: Mar 2011
Location: Greater Vancouver, Canada
Device: Kindle Paperwhite 10, iPhone, iPad
Thanks to whomever resurrected this thread. Reading through it has been very instructional.
hrynkiw is offline  
Old 05-11-2011, 03:09 AM   #83
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by hrynkiw View Post
Thanks to whomever resurrected this thread. Reading through it has been very instructional.
Moderator Notice
Just as a side note, since you mentioned resurrection: Generally, we prefer if people create new threads instead of reopening old ones. Calibre develops so fast that information in threads as old as a week may be outdated.
Manichean is offline  
Old 05-17-2011, 06:54 PM   #84
hrynkiw
Connoisseur
hrynkiw doesn't litterhrynkiw doesn't litter
 
hrynkiw's Avatar
 
Posts: 74
Karma: 154
Join Date: Mar 2011
Location: Greater Vancouver, Canada
Device: Kindle Paperwhite 10, iPhone, iPad
Yup, and if this thread had been about some feature of Calibre, that's what I would have done. But I don't think regular expressions have changed all that much even in a couple of years.

Cheers.
hrynkiw is offline  
Old 05-18-2011, 02:50 AM   #85
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by hrynkiw View Post
Yup, and if this thread had been about some feature of Calibre, that's what I would have done. But I don't think regular expressions have changed all that much even in a couple of years.
Their practical application in Calibre has. Plus, we've had a few huge catch-all threads in the past, and they were absolutely horrendous for users to find questions that have already been answered.
Manichean is offline  
Old 09-27-2011, 10:27 AM   #86
ZaMotH
Junior Member
ZaMotH began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2011
Device: IQ pocketbook
New problem

Hi all. My first post was not posted in the right place.

All right, here are possible my format lists :
1) Series # 00.zip
2) Series # 00 - Title.zip
3) Series # 00 - Title [author].zip
4) Series # 00 [Author].zip
5) Title.zip
6) Title [Author].zip

Without the author, I found out that this would work perfectly for 1, 2 and 5
(?P<series>.+) # (?P<series_index>\d+)( - (?P<title>.+)|)

as for case 1, series and series_index are filled, AND title = Series # 00



But everytime I try to add the " [Author]", I get messed up all around.
I know the parsing should go like ( \[(?P<author>.+)\[)
But I can not make it conditional

Can anyone help ?
ZaMotH is offline  
Old 09-27-2011, 02:37 PM   #87
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by ZaMotH View Post
Hi all. My first post was not posted in the right place.

All right, here are possible my format lists :
1) Series # 00.zip
2) Series # 00 - Title.zip
3) Series # 00 - Title [author].zip
4) Series # 00 [Author].zip
5) Title.zip
6) Title [Author].zip

Without the author, I found out that this would work perfectly for 1, 2 and 5
(?P<series>.+) # (?P<series_index>\d+)( - (?P<title>.+)|)

as for case 1, series and series_index are filled, AND title = Series # 00



But everytime I try to add the " [Author]", I get messed up all around.
I know the parsing should go like ( \[(?P<author>.+)\[)
But I can not make it conditional

Can anyone help ?
Allow me to just quote myself a little bit:
Quote:
Originally Posted by Manichean View Post
Moderator Notice
Just as a side note, since you mentioned resurrection: Generally, we prefer if people create new threads instead of reopening old ones. Calibre develops so fast that information in threads as old as a week may be outdated.
Quote:
Originally Posted by Manichean View Post
[W]e've had a few huge catch-all threads in the past, and they were absolutely horrendous for users to find questions that have already been answered.
Moderator Notice
In addition, you've actually managed to crosspost from this thread, which is where answers should go, since it's already active. I'm closing this thread down, so it can finally rest in peace.
Manichean is offline  
Closed Thread

Tags
regex, regular expressions


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help smartmart Calibre 5 10-17-2010 05:19 AM
Need Help Creating a Regular Expression Worm Calibre 9 08-18-2010 01:20 PM
Regular Expression Help Needed dloyer4 Calibre 1 07-25-2010 10:37 PM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM
I don't know how to use wilcards and regular expression.... superanima Sigil 4 02-21-2010 09:42 AM


All times are GMT -4. The time now is 05:01 AM.


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