Extract the language code from a news article filename or executive-brief Markdown filename.
Recognised patterns:
news/YYYY-MM-DD-slug-<lang>.html
analysis/daily/.../executive-brief_<lang>.md
Returns null for the canonical English source executive-brief.md (no suffix) โ callers must handle that file via path-based ownership rules.
null
executive-brief.md
The file path to extract the language from
The two-letter language code, or null if no match
Extract the language code from a news article filename or executive-brief Markdown filename.
Recognised patterns:
news/YYYY-MM-DD-slug-<lang>.html(HTML article)analysis/daily/.../executive-brief_<lang>.md(Markdown translation)Returns
nullfor the canonical English sourceexecutive-brief.md(no suffix) โ callers must handle that file via path-based ownership rules.