{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,2]],"date-time":"2026-10-02T07:58:17Z","timestamp":1790927897105,"version":"4.1.0"},"reference-count":43,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T00:00:00Z","timestamp":1723680000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2024,8,15]]},"abstract":"<jats:p>We present an executable, proven-safe, faithful, and future-proof Coq mechanization of JavaScript regular expression (regex) matching, as specified by the latest published edition of ECMA-262 section 22.2. This is, to our knowledge, the first time that an industrial-strength regex language has been faithfully mechanized in an interactive theorem prover. We highlight interesting challenges that arose in the process (including issues of encoding, corner cases, and executability), and we document the steps that we took to ensure that the result is straightforwardly auditable and that our understanding of the specification aligns with existing implementations.<\/jats:p>\n                  <jats:p>We demonstrate the usability and versatility of the mechanization through a broad collection of analyses, case studies, and experiments: we prove that JavaScript regex matching always terminates and is safe (no assertion failures); we identify subtle corner cases that led to mistakes in previous publications; we verify an optimization extracted from a state-of-the-art regex engine; we show that some classic properties described in automata textbooks and used in derivatives-based matchers do not hold in JavaScript regexes; and we demonstrate that the cost of updating the mechanization to account for changes in the original specification is reasonably low.<\/jats:p>\n                  <jats:p>Our mechanization can be extracted to OCaml and JavaScript and linked with Unicode libraries to produce an executable regex engine that passes the relevant parts of the official Test262 conformance test suite.<\/jats:p>","DOI":"10.1145\/3674666","type":"journal-article","created":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T12:49:04Z","timestamp":1723726144000},"page":"1003-1031","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":7,"title":["A Coq Mechanization of JavaScript Regular Expression Semantics"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0009-0006-5119-3895","authenticated-orcid":false,"given":"No\u00e9","family":"De Santo","sequence":"first","affiliation":[{"name":"EPFL, Lausanne, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7297-2170","authenticated-orcid":false,"given":"Aur\u00e8le","family":"Barri\u00e8re","sequence":"additional","affiliation":[{"name":"EPFL, Lausanne, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-1900-3901","authenticated-orcid":false,"given":"Cl\u00e9ment","family":"Pit-Claudel","sequence":"additional","affiliation":[{"name":"EPFL, Lausanne, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2024,8,15]]},"reference":[{"key":"e_1_3_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/3656431"},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","unstructured":"Martin Berglund Frank Drewes and Brink van der Merwe. 2014. Analyzing Catastrophic Backtracking Behavior in Practical Regular Expression Matching. In Proceedings 14th International Conference on Automata and Formal Languages AFL 2014 Szeged Hungary May 27-29 2014 (EPTCS Vol. 151) Zolt\u00e1n \u00c9sik and Zolt\u00e1n F\u00fclop (Eds.). 109\u2013123. https:\/\/doi.org\/10.4204\/EPTCS.151.7 10.4204\/EPTCS.151.7","DOI":"10.4204\/EPTCS.151.7"},{"key":"e_1_3_1_4_1","doi-asserted-by":"publisher","DOI":"10.1016\/J.TCS.2016.09.006"},{"key":"e_1_3_1_5_1","first-page":"30","volume-title":"Proceedings of the Prague Stringology Conference 2017, Prague, Czech Republic, August 28\u201330, 2017,","author":"Berglund Martin","year":"2017","unstructured":"Martin Berglund and Brink van der Merwe. 2017b. Regular Expressions with Backreferences Re-examined. In Proceedings of the Prague Stringology Conference 2017, Prague, Czech Republic, August 28\u201330, 2017, Jan Holub and Jan Zd\u00e1rek (Eds.). Department of Theoretical Computer Science, Faculty of Information Technology, Czech Technical University in Prague, 30\u201341. http:\/\/www.stringology.org\/event\/2017\/p04.html"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/2535838.2535876"},{"key":"e_1_3_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/321239.321249"},{"key":"e_1_3_1_8_1","unstructured":"Mathias Bynens. 2024. Tests for RegExp Unicode property escapes. https:\/\/github.com\/mathiasbynens\/unicode-property-escapes-tests."},{"key":"e_1_3_1_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-37036-6_3"},{"key":"e_1_3_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3184558.3185969"},{"key":"e_1_3_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3498707"},{"key":"e_1_3_1_12_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPICS.FSCD.2022.15"},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3591287"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236024.3236027"},{"key":"e_1_3_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3338906.3338909"},{"key":"e_1_3_1_16_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP40001.2021.00032"},{"key":"e_1_3_1_17_1","doi-asserted-by":"publisher","unstructured":"No\u00e9 De Santo Aur\u00e8le Barri\u00e8re and Cl\u00e9ment Pit-Claudel. 2024a. Artifact for \u201cA Coq Mechanization ofJavaScript Regular Expression Semantics\u201d at ICFP 2024 (latest). https:\/\/doi.org\/10.5281\/zenodo.11494316 10.5281\/zenodo.11494316","DOI":"10.5281\/zenodo.11494316"},{"key":"e_1_3_1_18_1","doi-asserted-by":"publisher","unstructured":"No\u00e9 De Santo Aur\u00e8le Barri\u00e8re and Cl\u00e9ment Pit-Claudel. 2024b. Artifact for \u201cA Coq Mechanization ofJavaScript Regular Expression Semantics\u201d at ICFP 2024 (v1). https:\/\/doi.org\/10.5281\/zenodo.11494317 10.5281\/zenodo.11494317","DOI":"10.5281\/zenodo.11494317"},{"key":"e_1_3_1_19_1","unstructured":"Mark Jason Dominus. 2000. Perl Regular Expression Matching is NP-Hard. https:\/\/perl.plover.com\/NPC\/NPC-3SAT.html."},{"key":"e_1_3_1_20_1","unstructured":"ECMA. 2023. ECMA-262 14th edition: ECMAScript\u00ae 2023 Language Specification. https:\/\/262.ecma-international.org\/14.0\/index.html"},{"key":"e_1_3_1_21_1","unstructured":"ESLint. 2024. regexpp. https:\/\/github.com\/eslint-community\/regexpp."},{"key":"e_1_3_1_22_1","unstructured":"Arjun Guha and Benjamin Lerner. 2012. Mechanized LambdaJS. https:\/\/github.com\/brownplt\/LambdaJS\/blob\/master\/coq\/LambdaJS_Defs.v."},{"key":"e_1_3_1_23_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796897002864"},{"key":"e_1_3_1_24_1","unstructured":"Iain Ireland. 2020. A New RegExp Engine in SpiderMonkey. https:\/\/hacks.mozilla.org\/2020\/06\/a-new-regexp-engine-in-spidermonkey\/."},{"key":"e_1_3_1_25_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-69407-6_39"},{"key":"e_1_3_1_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314645"},{"key":"e_1_3_1_27_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-89330-1_22"},{"key":"e_1_3_1_28_1","unstructured":"Melange. 2024. Melange OCaml for JavaScript developers. https:\/\/melange.re."},{"key":"e_1_3_1_29_1","doi-asserted-by":"publisher","DOI":"10.2197\/IPSJJIP.27.422"},{"key":"e_1_3_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3591262"},{"key":"e_1_3_1_31_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796808007090"},{"key":"e_1_3_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/2737924.2737991"},{"key":"e_1_3_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3540250.3549097"},{"key":"e_1_3_1_34_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE51524.2021.9678781"},{"key":"e_1_3_1_35_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00015"},{"key":"e_1_3_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3324884.3416632"},{"key":"e_1_3_1_37_1","doi-asserted-by":"publisher","DOI":"10.1016\/J.JAL.2011.11.003"},{"key":"e_1_3_1_38_1","unstructured":"TC39. 2022. TC39 Meeting Notes. https:\/\/github.com\/tc39\/notes\/blob\/main\/meetings\/2022-01\/jan-26.md"},{"key":"e_1_3_1_39_1","unstructured":"TC39. 2023. Test262 commit 4d44acbc033c8aa38896f41fb3bdc96d6aeee2b8. https:\/\/github.com\/tc39\/test262\/commit\/4d44acbc"},{"key":"e_1_3_1_40_1","unstructured":"V8. 2019. Improving V8 regular expressions. https:\/\/v8.dev\/blog\/regexp-tier-up."},{"key":"e_1_3_1_41_1","unstructured":"V8. 2021. An Additional Non-backtracking RegExp Engine. https:\/\/v8.dev\/blog\/non-backtracking-regexp."},{"key":"e_1_3_1_42_1","unstructured":"V8. 2023. Issue 14098: [Regexp] Mismatch between the Experimental engine and the backtracking engine on empty repetitions. https:\/\/bugs.chromium.org\/p\/v8\/issues\/detail?id=14098."},{"key":"e_1_3_1_43_1","unstructured":"V8. 2024. The V8 JavaScript engine. https:\/\/v8.dev\/"},{"key":"e_1_3_1_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/3636501.3636959"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674666","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3674666","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T07:48:55Z","timestamp":1770191335000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674666"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,8,15]]},"references-count":43,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2024,8,15]]}},"alternative-id":["10.1145\/3674666"],"URL":"https:\/\/doi.org\/10.1145\/3674666","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,8,15]]},"assertion":[{"value":"2024-02-28","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-06-18","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-08-15","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}