Created
August 20, 2019 15:42
-
-
Save BlueSCar/2cb9f6af737a850b24affd2a793e3ae1 to your computer and use it in GitHub Desktop.
Regexes for parsing player names out of play types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
typeId: 3, | |
regex: /(?:Fumble by [^,]+, )?(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:N\/A))(?:(?: pass incomplete(?: to )*)([A-Z][^,\s]+(?: [A-Z'][^,\s]*)+)*)*(?:(?:, broken up by )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*/g, | |
types: [{ | |
id: 1, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 2, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 2, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 4, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?:(?: pass complete to )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?: [^.,]+[.,])(?:(?: tackled by )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?:(?: and )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*/g, | |
types: [{ | |
id: 4, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 5, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 6, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 6, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 5, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: (?:(?:rush)|(?:run)) for [^,]+)(?:, fumbled by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*(?:, tackled by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*/g, | |
types: [{ | |
id: 7, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 6, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 7, | |
regex: /(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM))(?: sacked)*(?:(?: by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: and )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: for (?:a loss of )*\d+ yard(?:s)*(?: to the (?:(?:\w+ \d+)|(?:\d+ \w+ \w+)))*(?: |,))([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)* fumbled)*(?:(?:, forced by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?:, recovered by )([A-Z][^,\s]+(?: [A-Z][^,.\s]+)+))*/g, | |
types: [{ | |
id: 11, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 9, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: (?:(?:rush)|(?:run)) for (?:a loss of )?(?:(?:no gain)|(?:\d{1,2} (?:y(?:ar)?ds?))) to the (?:(?:[A-Za-z ]+\d{1,2})|(?:50 yard line)) ?)(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: fumbled))*(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*(?:, tackled by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*/g, | |
types: [{ | |
id: 7, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 6, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 9, | |
regex: /(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM))(?: sacked)*(?:(?: by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: and )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: for (?:a loss of )*\d+ yard(?:s)*(?: to the (?:(?:\w+ \d+)|(?:\d+ \w+ \w+)))*(?: |,))([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)* fumbled)*(?:(?:, forced by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?:, recovered by )([A-Z][^,\s]+(?: [A-Z][^,.\s]+)+))*/g, | |
types: [{ | |
id: 11, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 9, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?:(?: pass complete to )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?: for (?:(?:no gain )|(?:\d{1,2} y(?:ar)?ds? ))([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) fumbled)(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?/g, | |
types: [{ | |
id: 4, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 5, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 12, | |
regex: /(?:(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)? ?kickoff for \d{1,2} yds(?: to the \D+\d)?(?: for a 1ST down)? ?, ?.? )|(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) on-side kick recovered by \D+ at the (?:(?:\D+ \d{1,2})|(?:50 yard line)) , ))(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) return(?: for (?:a loss of )?(?:(?:\d{1,2} y(?:ar)?ds?)|(?:no gain)))?(?: to the (?:(?:\D+\d{1,2})|(?:50 yard line)))?)(?: , ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) return for (?:a loss of )?(?:(?:\d{1,2} y(?:ar)?ds?)|(?:no gain)) to the (?:(?:\D+\d{1,2})|(?:50 yard line)))?(?: ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) fumbled)?(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?/g, | |
types: [{ | |
id: 13, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 14, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 15, | |
isOffense: false, | |
yardageStat: true | |
}, { | |
id: 15, | |
isOffense: false, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: false, | |
yardageStat: true | |
}, { | |
id: 9, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 17, | |
regex: /(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|TEAM) punt(?: blocked by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))+/g, | |
types: [{ | |
id: 16, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 17, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 18, | |
regex: /(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|TEAM) \d{1,2} yd FG BLOCKED(?: blocked by (?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: {2}([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?)?)/g, | |
types: [{ | |
id: 18, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 19, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 19, | |
isOffense: false, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 24, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) pass complete to ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)/g, | |
types: [{ | |
id: 4, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 5, | |
isOffense: true, | |
yardageStat: true | |
}] | |
}, { | |
typeId: 26, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) pass intercepted(?:, touchback.)?(?: for a 1ST down)? ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)/g, | |
types: [{ | |
id: 20, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 21, | |
isOffense: false, | |
yardageStat: true | |
}] | |
}, { | |
typeId: 29, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: (?:(?:rush)|(?:run)) for (?:a loss of )?(?:(?:no gain)|(?:\d{1,2} (?:y(?:ar)?ds?))) to the (?:(?:[A-Za-z ]+\d{1,2})|(?:50 yard line)) ?)(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?: fumbled))*(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*(?:, tackled by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)[^,]+)*/g, | |
types: [{ | |
id: 7, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 6, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 9, | |
regex: /(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM))(?: sacked)*(?:(?: by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: and )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?: for (?:a loss of )*\d+ yard(?:s)*(?: to the (?:(?:\w+ \d+)|(?:\d+ \w+ \w+)))*(?: |,))([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)* fumbled)*(?:(?:, forced by )(?:([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)|(?:TEAM)))*(?:(?:, recovered by )([A-Z][^,\s]+(?: [A-Z][^,.\s]+)+))*/g, | |
types: [{ | |
id: 11, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 12, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 8, | |
isOffense: true, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}, { | |
typeId: 9, | |
regex: /([A-Z][^,\s]+(?: [A-Z][^,\s]+)+)(?:(?: pass complete to )([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))*(?: for (?:(?:no gain )|(?:\d{1,2} y(?:ar)?ds? ))([A-Z][^,\s]+(?: [A-Z][^,\s]+)+) fumbled)(?:, forced by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?(?:, recovered by ([A-Z][^,\s]+(?: [A-Z][^,\s]+)+))?/g, | |
types: [{ | |
id: 4, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 5, | |
isOffense: true, | |
yardageStat: true | |
}, { | |
id: 8, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 9, | |
isOffense: false, | |
yardageStat: false | |
}, { | |
id: 10, | |
isOffense: true, | |
yardageStat: false | |
}] | |
}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment