Hi, people who are less terrible than me at programming languages:
I'm trying to write a macro or hazel rule that parses certain information in a PDF's filename into that PDF's metadata (to then use in DT3 smart rules).
These are law cases that are titled by their citations. The citations are in various formats, but all of them begin with "R. v. [NAME]" and include the year somewhere, for example:
R. v. Glue,  S.C.J. No. 18
R. v. Glue, 2019 ONCA 494
R. v. Glue (2019), 129 C.C.C. (3d) 443
…among others. What I'm hoping to do regardless of format is parse out [Glue] (i.e. the word after "v.") into the "Title" metadata field and  (i.e. a year in 19## or 20## format) into the "Date" metadata field.
I just spent an unhappy half-hour trying to adapt the bash in Desalegn's post here—but it occurred to me that what will probably take me hours to get right might be the work of seconds for someone with a moment to spare in this generous community. Or maybe someone has a better idea of how to go about doing this?.
Thanks so much!!