REGEXVAULTv2.0
Security/Audit & Compliance
Verified Safe

ISO 27001 Control Reference Regex for JavaScript

/^(?:5|6|7|8)\.(?:[1-9]|[1-3][0-9]|4[0-1])(?:\.(?:[1-9]|[1-2][0-9]|30))?$/

What this pattern does

This page provides a well-structured, multi-part regular expression for matching iso 27001 control reference, ported and verified for JavaScript. In security-sensitive code, using an unverified regex can open the door to both false positives and denial-of-service attacks. The snippet below is ready to drop into your JavaScript project — whether you're validating in an Express middleware, a Next.js API route, or a client-side form.

Javascript Implementation

Javascript
// ISO 27001 Control Reference
// ReDoS-safe | RegexVault — Security > Audit & Compliance

const iso27001ControlReferenceRegex = /^(?:5|6|7|8)\.(?:[1-9]|[1-3][0-9]|4[0-1])(?:\.(?:[1-9]|[1-2][0-9]|30))?$/;

function validateIso27001ControlReference(input: string): boolean {
  return iso27001ControlReferenceRegex.test(input);
}

// Example
console.log(validateIso27001ControlReference("5.1")); // true

Test Cases

Matches (Valid)
Rejects (Invalid)
5.14.1
5.239.1
6.35.42
7.50.1
8.285.1.1.1
8.1.1

When to use this pattern

This pattern is drawn from the Security > Audit & Compliance category and carries a ReDoS-safe certification. That matters for JavaScript developers because especially critical in long-running Node.js event loops where a ReDoS vulnerability can block the entire process. RegexVault audits patterns against known backtracking attack vectors, ensuring you have the necessary context before using this regex in a high-stakes production environment.

Common Pitfalls

ISO 27001:2013 uses the A.X.X.X control format (e.g., A.9.1.1) which is structurally different from the 2022 format. Specify the version when referencing controls. The 2022 edition has 93 controls vs 114 in 2013.

Technical Notes

ISO 27001:2022 control domains: 5 (Organizational, controls 5.1-5.37), 6 (People, 6.1-6.8), 7 (Physical, 7.1-7.14), 8 (Technological, 8.1-8.34). The 2022 update reorganized from the 2013 version's A.5-A.18 structure. Clause 4-10 are the ISMS requirements (not controls).

Have a pattern that belongs in the vault?

Submit it for review — community-verified patterns get credited to your GitHub handle. Free submissions join the queue. Priority review available for $15.

Submit a Pattern