11-04-2017, 11:30 AM | #1 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Dec 2015
Device: kpw2
|
Splitting multiple author names - RegEx little modification?
Hello
So the basic RegEx is: Code:
authors_split_regex = '(?i),?\\s+(and|with)\\s+' How for such case the RegEx could look like? |
05-25-2020, 07:19 AM | #2 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Dec 2015
Device: kpw2
|
Bump
|
05-25-2020, 09:57 AM | #3 |
Well trained by Cats
Posts: 29,820
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Bumping is frowned upon.
Necro-bumping is really frowned upon |
05-25-2020, 10:00 AM | #4 |
Grand Sorcerer
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Waiting over two years for a response before bumping shows an incredible level of patience.
|
05-25-2020, 06:08 PM | #5 | |
null operator (he/him)
Posts: 20,590
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Or font332 was hibernating, as most of us have been forced/coerced into doing recently. Hopefully a regex guru (which I'm not) will give font332 an answer to the question he/she posted in 2017. Even Qt and MS are sometimes quicker than that BR |
|
05-25-2020, 08:52 PM | #6 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
With the emoticon, I can't decide if @font332 is being serious or not. But...
My first thought was simply: Code:
(?i),?\\s+(and|with|;)\\s+ I think the following works: Code:
(?i),?(\\s*;\\s*|\\s+(?:and|with)\\s+) |
05-26-2020, 11:01 PM | #7 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Dec 2015
Device: kpw2
|
Thanks everyone for the interest.
In fact I think I've probably solved my problem at that time, but then I lost my library and forgot the formula and regex also. It's been already few times in my life re-learning the regex, but we have to know when to say stop. That's partly why I bumped this dusty topic. Thank you @davidfor for the formula, it probably doesn't work tho. I say probably because the way how I checked this is that normally when we are typing the authors in author field and we type "&" symbol, calibre will start to give a list of suggestion for another author. This doesn't happen for ";" symbol. I think anyway I will not make life more complicated then necessary and I will give up this idea and just convert and use for the future the "&" symbol. |
05-27-2020, 12:32 AM | #8 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
05-28-2020, 12:47 AM | #9 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Dec 2015
Device: kpw2
|
Thanks for clarification
|
Tags |
calibre, regex, regular expression |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bulk changing author names to author sort in tag browser | AussieTupp | Library Management | 6 | 02-05-2017 04:22 AM |
Regex to find author names all in uppercase? | Vortex | Library Management | 3 | 08-03-2016 06:50 PM |
Splitting multiple html files? | nqk | Editor | 5 | 11-27-2015 02:08 AM |
Splitting of multiple authors | Jellby | Calibre | 1 | 04-01-2013 11:34 AM |
Splitting the Bible into Multiple Files | SciFiGal777 | Ectaco jetBook | 3 | 03-27-2010 09:35 PM |