Parsing Indian case-law citations with regular expressions (R and Python)
Indian reported judgments are cited in several parallel systems: proprietary law reports such as Supreme Court Cases (SCC) and the All India Reporter (AIR), the official Supreme Court Reports (SCR), state High Court journals, and, since 2023, a Supreme Court neutral citation. The same decision often has more than one citation. Kesavananda Bharati Sripadagalvaru v. State of Kerala, for example, is AIR 1973 SC 1461, (1973) 4 SCC 225, and [1973] Supp. (1) S.C.R. 1.
This note gives compact, reusable regular expressions for the formats you will see most often, plus short stringr (R) and Python snippets. The patterns use only numbered capture groups so the same pattern string works in Python’s re module and in stringr’s ICU engine. They were tested on a short corpus of real citations; the Python session output below is from an actual run, not a constructed transcript.
1. The common formats
SCC — (year) volume SCC page
Eastern Book Company’s Supreme Court Cases is the form most often used in contemporary writing. Justice K.S. Puttaswamy (Retd.) v. Union of India, the nine-judge privacy decision, is (2017) 10 SCC 1. The year is written in parentheses, then the volume, the abbreviation SCC, and the starting page.
AIR — AIR year court page
The All India Reporter prefix is followed by the year, a court abbreviation, and the page. For the Supreme Court the court code is SC, as in Kesavananda Bharati, AIR 1973 SC 1461. High Court reports use the same skeleton with a High Court code instead of SC — for example Del, Bom, Cal, Mad, Kar or Kant, All, Pat, Ker, Guj, Raj, MP, or P&H. The pattern below accepts those alphabetic codes (and P&H).
SCR — [year] volume S.C.R. page, including supplements
The official Supreme Court Reports place the year in square brackets. A straightforward example is [2023] 1 S.C.R. 1 (Vivek Narayan Sharma v. Union of India, on the official Digital SCR). Older or supplemental volumes insert Supp. or Suppl., sometimes with a series number in parentheses: Kesavananda Bharati is [1973] Supp. (1) S.C.R. 1. Punctuation in S.C.R. is often omitted in typing, so the pattern treats the dots as optional.
High Court reporters — year-first or volume-first
Many High Court journals copy the SCC layout, (year) volume REPORTER page. Others put the volume first. Naz Foundation v. Government of NCT of Delhi is reported in the Delhi Law Times as (2009) 160 DLT 277 and is also written 160 (2009) DLT 277. The same two orders appear in other series (for example Bom CR, KLT, CTC, CHN, KCCR, MhLJ, GLR, AWC). The list of reporter abbreviations in the pattern is illustrative, not exhaustive — extend the alternation when you add a series. Indian Law Reports (ILR) often use a slightly different shape (court name and sometimes a part number) and are left to a dedicated pattern.
Supreme Court neutral citation — 2023 INSC 1
In July 2023 the Supreme Court of India announced a neutral citation in the compact form 2023INSC1: a four-digit year, the court code INSC (India Supreme Court), and a serial number. In running text this is almost always spaced, 2023 INSC 1. The pattern below accepts both. Several High Courts later adopted analogous year–court–number schemes; the exact court codes differ, so this note keeps the Supreme Court form separate.
2. Regular expressions
All patterns below are case-insensitive. Years are restricted to 19xx and 20xx so a random four-digit figure is less likely to be treated as a reporter year.
| Format | Pattern | Groups |
|---|---|---|
| SCC | \(((?:19|20)\d{2})\)\s+(\d+)\s+SCC\s+(\d+) |
year, volume, page |
| AIR | AIR\s+((?:19|20)\d{2})\s+(P\s*&\s*H|[A-Z]{1,6}|[A-Z][a-z]+)\s+(\d+) |
year, court, page |
| SCR | \[((?:19|20)\d{2})\]\s+(?:(Supp(?:l)?\.?)\s*(?:\((\d+)\)\s*)?)?(?:(\d+)\s+)?S\.?\s*C\.?\s*R\.?\s+(\d+) |
year, “Supp” token, supplement series, volume, page |
| High Court, year first | \(((?:19|20)\d{2})\)\s+(\d+)\s+(DLT|Bom\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\s+(\d+) |
year, volume, reporter, page |
| High Court, volume first | (\d+)\s+\(((?:19|20)\d{2})\)\s+(DLT|Bom\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\s+(\d+) |
volume, year, reporter, page |
| INSC | ((?:19|20)\d{2})\s*INSC\s*(\d+) |
year, serial number |
A pinpoint after a comma, as in (2017) 10 SCC 1, 45, is not part of the core citation: the page group is the starting page 1. These patterns also do not try to parse party names, case numbers such as W.P. (C) 135 of 1970, or SCC OnLine citations, which use a different “OnLine” token and numbering.
3. Python
import re
SCC = r"\(((?:19|20)\d{2})\)\s+(\d+)\s+SCC\s+(\d+)"
AIR = r"AIR\s+((?:19|20)\d{2})\s+(P\s*&\s*H|[A-Z]{1,6}|[A-Z][a-z]+)\s+(\d+)"
SCR = (
r"\[((?:19|20)\d{2})\]\s+"
r"(?:(Supp(?:l)?\.?)\s*(?:\((\d+)\)\s*)?)?"
r"(?:(\d+)\s+)?"
r"S\.?\s*C\.?\s*R\.?\s+(\d+)"
)
HC_YEAR_FIRST = (
r"\(((?:19|20)\d{2})\)\s+(\d+)\s+"
r"(DLT|Bom\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\s+(\d+)"
)
HC_VOL_FIRST = (
r"(\d+)\s+\(((?:19|20)\d{2})\)\s+"
r"(DLT|Bom\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\s+(\d+)"
)
INSC = r"((?:19|20)\d{2})\s*INSC\s*(\d+)"
text = (
"Justice K.S. Puttaswamy (Retd.) v. Union of India, (2017) 10 SCC 1, is the "
"nine-judge privacy decision. Kesavananda Bharati Sripadagalvaru v. State of "
"Kerala is cited as AIR 1973 SC 1461, and equivalently as (1973) 4 SCC 225 and "
"as [1973] Supp. (1) S.C.R. 1. A later official-report example is "
"[2023] 1 S.C.R. 1. The Delhi High Court decision in Naz Foundation v. "
"Government of NCT of Delhi appears as (2009) 160 DLT 277, and is also written "
"160 (2009) DLT 277. The Supreme Court notice describes the compact form "
"2023INSC1; in running text the spaced form is 2023 INSC 1."
)
for name, pat in [
("SCC", SCC),
("AIR", AIR),
("SCR", SCR),
("High Court (year first)", HC_YEAR_FIRST),
("High Court (volume first)", HC_VOL_FIRST),
("INSC", INSC),
]:
print(f"{name}:")
for m in re.finditer(pat, text, flags=re.I):
print(f" {m.group(0)!r}")
print(f" {m.groups()}")
4. R, with stringr
The same pattern strings work in stringr. Backslashes are doubled inside ordinary R strings (or you can use R raw strings, r"(...)", in R 4.0 and later). The session output in the next section is from Python only; I did not run R here.
library(stringr)
scc <- "\\(((?:19|20)\\d{2})\\)\\s+(\\d+)\\s+SCC\\s+(\\d+)"
air <- "AIR\\s+((?:19|20)\\d{2})\\s+(P\\s*&\\s*H|[A-Z]{1,6}|[A-Z][a-z]+)\\s+(\\d+)"
scr <- "\\[((?:19|20)\\d{2})\\]\\s+(?:(Supp(?:l)?\\.?)\\s*(?:\\((\\d+)\\)\\s*)?)?(?:(\\d+)\\s+)?S\\.?\\s*C\\.?\\s*R\\.?\\s+(\\d+)"
hc_year_first <- "\\(((?:19|20)\\d{2})\\)\\s+(\\d+)\\s+(DLT|Bom\\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\\s+(\\d+)"
hc_vol_first <- "(\\d+)\\s+\\(((?:19|20)\\d{2})\\)\\s+(DLT|Bom\\s*CR|KLT|CTC|CHN|KCCR|MhLJ|GLR|AWC)\\s+(\\d+)"
insc <- "((?:19|20)\\d{2})\\s*INSC\\s*(\\d+)"
text <- paste(
"Justice K.S. Puttaswamy (Retd.) v. Union of India, (2017) 10 SCC 1, is the",
"nine-judge privacy decision. Kesavananda Bharati Sripadagalvaru v. State of",
"Kerala is cited as AIR 1973 SC 1461, and equivalently as (1973) 4 SCC 225 and",
"as [1973] Supp. (1) S.C.R. 1. A later official-report example is",
"[2023] 1 S.C.R. 1. The Delhi High Court decision in Naz Foundation v.",
"Government of NCT of Delhi appears as (2009) 160 DLT 277, and is also written",
"160 (2009) DLT 277. The Supreme Court notice describes the compact form",
"2023INSC1; in running text the spaced form is 2023 INSC 1."
)
str_match_all(text, regex(scc, ignore_case = TRUE))
str_match_all(text, regex(air, ignore_case = TRUE))
str_match_all(text, regex(scr, ignore_case = TRUE))
str_match_all(text, regex(hc_year_first, ignore_case = TRUE))
str_match_all(text, regex(hc_vol_first, ignore_case = TRUE))
str_match_all(text, regex(insc, ignore_case = TRUE))
5. Session output (Python, actually run)
The following is the unedited stdout of the Python patterns on the corpus above, run with Python 3.13.5. Capture names in the printed dictionaries are labels applied after the match, not named groups inside the pattern.
Python 3.13.5
SCC:
'(2017) 10 SCC 1'
{'year': '2017', 'volume': '10', 'page': '1'}
'(1973) 4 SCC 225'
{'year': '1973', 'volume': '4', 'page': '225'}
AIR:
'AIR 1973 SC 1461'
{'year': '1973', 'court': 'SC', 'page': '1461'}
SCR:
'[1973] Supp. (1) S.C.R. 1'
{'year': '1973', 'supp': 'Supp.', 'supp_series': '1', 'volume': None, 'page': '1'}
'[2023] 1 S.C.R. 1'
{'year': '2023', 'supp': None, 'supp_series': None, 'volume': '1', 'page': '1'}
High Court (year first):
'(2009) 160 DLT 277'
{'year': '2009', 'volume': '160', 'reporter': 'DLT', 'page': '277'}
High Court (volume first):
'160 (2009) DLT 277'
{'volume': '160', 'year': '2009', 'reporter': 'DLT', 'page': '277'}
INSC:
'2023INSC1'
{'year': '2023', 'number': '1'}
'2023 INSC 1'
{'year': '2023', 'number': '1'}
6. A few practical caveats
- Run the High Court year-first and volume-first patterns as alternatives, not as a single naive search: both can match on the same span around
(2009) 160 DLT 277/160 (2009) DLT 277. Prefer the longer match, or search volume-first only after year-first has been removed. - The AIR court group is a short alphabetic token. That is enough for
SCand the usual High Court codes, but it will also accept typographical noise if the letters sit between a year and a page number after the lettersAIR. - For SCR, group 4 (volume) is empty on a supplemental citation such as
[1973] Supp. (1) S.C.R. 1; the series number is in group 3. On[2023] 1 S.C.R. 1, group 4 is the volume and the supplement groups are empty. - These expressions do not resolve equivalent citations. Once you have parsed
AIR 1973 SC 1461, mapping it to(1973) 4 SCC 225is a data problem, not a regular-expression problem.
To look up a citation once parsed, you can search it on SooperKanoon, a free Indian case-law search.