I have the following lines:
1 "R J BRUCE & OTHERS V B J & W L A EDWARDS And Ors CA CA19/02 27 February 2003",
2 "H v DIRECTOR OF PROCEEDINGS [2014] NZHC 1031 [16 May 2014]",
3 '''GREGORY LANCASTER AND JOHN HENRY HUNTER V CULLEN INVESTMENTS LIMITED AND
ERIC JOHN WATSON CA CA51/03 26 May 2003'''
I am trying to find a regex that matches all of them. I do not know how to match optional square brackets around the date at the end of a string, for example [May 16, 2014].
casename = re.compile(r'(^[A-Z][A-Za-z\'\(\) ]+\b[v|V]\b[A-Za-z\'\(\) ]+(.*?)[ \[ ]\d+ \w+ \d\d\d\d[\] ])', re.S)
The regular expression of the date at the end corresponds only to cases with dates in square brackets, but not to those who do not.
Thanks to all who responded. @Matt Clarkson, what I'm trying to combine is a court decision to “process” in a much larger text. There is a lot of variation inside these descriptors, but they all start at the beginning of the string "v" compared to the names of the parties and the date at the end. Basically, the names of the parties are in equity, but not exclusively. I try to have only one match per document and no false positives.
source
share