View Single Post
Old 06-18-2021, 11:28 AM   #8
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 782
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Sage
Thanks. I'd been wondering if there were a way to check the end of line. Knowing that $ should come in handy. And I should have thought of the \2 \1 replacement.

Regarding the "full" search:

^(.+),\s(the|a|an)$

I'd wondered about matching "a" before "an". Is the regex parsed left-to-right within the parentheses? If it is, it might catch a trailing

", an"

as

", a"

and leave an "n" hanging off the end of the title. Perhaps just changing the order to:

^(.+),\s(the|an|a)$

would do it.

EDIT: Oops. Nope. That's what the "anchor to the end" "$" is for. With that, "a" won't match "an" since it's not the last string. Sorry.

Last edited by enuddleyarbl; 06-18-2021 at 12:28 PM.
enuddleyarbl is offline   Reply With Quote