View Single Post
Old 06-28-2023, 03:53 PM   #8568
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,052
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I got it roughly working. Play around with it here: https://regex101.com/r/rVliD2/1

I think this would be:
Code:
ships=>((\d+)th Doctor)(/| &amp; )(.*)=>\g<4>\g<3>\g<1>
I couldn't entirely account for a third character - you can see that "Rose Tyler &amp; Jack Harkness" is actually one capture group. I think there's ways around this (greedy regexes, maybe) but it's a bit past my knowledge.

Also, you might need to change the 'th' part to something like (rd|th) for other Doctors.

Last edited by ownedbycats; 06-28-2023 at 04:26 PM.
ownedbycats is offline   Reply With Quote