Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2026, 05:47 AM   #1
THartmann9374
Junior Member
THartmann9374 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2026
Device: none
Fixing Titles using regular expression

Hello all,
I'm trying to figure how to trim down titles using regular expressions. For example, the title would be like this "OSS 123 - this is example" and I want to trim down to "OSS 124", so how I delete "this is example"?

Other books like this

RAID 345 - this is other example
OSS 643 - this is different example
GI: This is solider

Okay, I know it sounds silly, but I want to do batch to trim down to RAID 345, OSS 643 and GI. How do I do in regular expression?

Thanks! THartmann9374
THartmann9374 is offline   Reply With Quote
Old 03-13-2026, 06:02 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,482
Karma: 31000706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Trim where - in the Book itself, or in the Library metadata?

BR
BetterRed is offline   Reply With Quote
Old 03-13-2026, 09:22 AM   #3
THartmann9374
Junior Member
THartmann9374 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2026
Device: none
Quote:
Originally Posted by BetterRed View Post
Trim where - in the Book itself, or in the Library metadata?

BR
Library with Bulk thing
THartmann9374 is offline   Reply With Quote
Old 03-13-2026, 01:04 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,596
Karma: 62544528
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Moderator Notice
Moved, this is a Metadata Editor Q, not a Editor Q.
theducks is online now   Reply With Quote
Old 03-13-2026, 01:19 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,596
Karma: 62544528
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Here you go
looks for Caps, a space followed by digits followed by a space dash /anything/
only saves the part up to the dash
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2026-03-13 10-16-36.png
Views:	14
Size:	67.6 KB
ID:	221730  
theducks is online now   Reply With Quote
Old 03-13-2026, 05:02 PM   #6
THartmann9374
Junior Member
THartmann9374 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2026
Device: none
Quote:
Originally Posted by theducks View Post
Here you go
looks for Caps, a space followed by digits followed by a space dash /anything/
only saves the part up to the dash
Thanks so much! It works! I keep this for my future reference! One more thing, suppose it is OSS 123. instead of OSS 123 - that it.

Thanks! THartmann9374
THartmann9374 is offline   Reply With Quote
Old 03-13-2026, 06:55 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,596
Karma: 62544528
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Grab a REGEDIT cheat sheet (and a CSS one while you are at it )
I like cheatography ones.
a period is a REGEDIT special character You saw .+? all 3 have special meaning
Calibre and Sigil use PCRE flavor, so not all on the sheet apply

special characters need to be 'escaped', thus \.
\s is any kind of space
\d any digit
theducks is online now   Reply With Quote
Old 03-13-2026, 07:00 PM   #8
THartmann9374
Junior Member
THartmann9374 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2026
Device: none
Quote:
Originally Posted by theducks View Post
Grab a REGEDIT cheat sheet (and a CSS one while you are at it )
I like cheatography ones.
a period is a REGEDIT special character You saw .+? all 3 have special meaning
Calibre and Sigil use PCRE flavor, so not all on the sheet apply

special characters need to be 'escaped', thus \.
\s is any kind of space
\d any digit
Thanks for this tip! Thanks again!
THartmann9374 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression help: complicated remaming of titles Ersatzreifen Library Management 1 03-30-2016 10:37 AM
More than 3 regular expression? james968 Conversion 1 04-04-2012 05:39 AM
Regular Expression Help iKarampa Calibre 13 12-15-2010 07:17 AM
Regular expression help krendk Calibre 4 12-04-2010 04:32 PM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM


All times are GMT -4. The time now is 02:18 PM.


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