{"id":13812751,"url":"https://github.com/tc39/proposal-regexp-r-escape","last_synced_at":"2025-04-19T17:34:15.324Z","repository":{"id":66059413,"uuid":"417634170","full_name":"tc39/proposal-regexp-r-escape","owner":"tc39","description":"Regular Expression `\\R` Escape for ECMAScript","archived":false,"fork":false,"pushed_at":"2021-12-04T02:51:21.000Z","size":195,"stargazers_count":5,"open_issues_count":3,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T10:51:18.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tc39.es/proposal-regexp-r-escape","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tc39.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-15T20:59:08.000Z","updated_at":"2023-12-31T03:57:21.000Z","dependencies_parsed_at":"2023-03-10T23:36:11.455Z","dependency_job_id":null,"html_url":"https://github.com/tc39/proposal-regexp-r-escape","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-regexp-r-escape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-regexp-r-escape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-regexp-r-escape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-regexp-r-escape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tc39","download_url":"https://codeload.github.com/tc39/proposal-regexp-r-escape/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249750232,"owners_count":21320103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:00:55.090Z","updated_at":"2025-04-19T17:34:15.308Z","avatar_url":"https://github.com/tc39.png","language":"HTML","funding_links":[],"categories":["JavaScript regex evolution"],"sub_categories":["Regex processors, utilities, and more"],"readme":"\u003c!--#region:intro--\u003e\n# Regular Expression `\\R` Escape for ECMAScript\n\n\u003c!--#endregion:intro--\u003e\n\n\u003c!--#region:status--\u003e\n## Status\n\n**Stage:** 1  \n**Champion:** Ron Buckton ([@rbuckton](https://github.com/rbuckton))  \n\n_For detailed status of this proposal see [TODO](#todo), below._  \n\u003c!--#endregion:status--\u003e\n\n\u003c!--#region:authors--\u003e\n## Authors\n\n* Ron Buckton ([@rbuckton](https://github.com/rbuckton))  \n\u003c!--#endregion:authors--\u003e\n\n\u003c!--#region:motivations--\u003e\n# Motivations\n\n\u003e NOTE: See https://github.com/rbuckton/proposal-regexp-features for an overview of\n\u003e how this proposal fits into other possible future features for Regular Expressions.\n\nThe `\\R` escape sequence matches the various sets of code points that match a unicode line terminator, which can be difficult to write correctly.\n\n\u003c!--#endregion:motivations--\u003e\n\n\u003c!--#region:prior-art--\u003e\n# Prior Art \n\n* [Perl](https://rbuckton.github.io/regexp-features/engines/perl.html#feature-line-endings-escape)  \n* [PCRE](https://rbuckton.github.io/regexp-features/engines/pcre.html#feature-line-endings-escape)  \n* [Boost.Regex](https://rbuckton.github.io/regexp-features/engines/boost.regex.html#feature-line-endings-escape)  \n* [Oniguruma](https://rbuckton.github.io/regexp-features/engines/oniguruma.html#feature-line-endings-escape)  \n* [ICU](https://rbuckton.github.io/regexp-features/engines/icu.html#feature-line-endings-escape)  \n* [Glib/GRegex](https://rbuckton.github.io/regexp-features/engines/glib-gregex.html#feature-line-endings-escape)  \n\nSee https://rbuckton.github.io/regexp-features/features/line-endings-escape.html for additional information.\n\n\u003c!--#endregion:prior-art--\u003e\n\n\u003c!--#region:syntax--\u003e\n# Syntax\n\n- `\\R` \u0026mdash; Matches any line ending character sequence.\n\n\u003e NOTE: Requires the `u` or `v` flags, as `\\R` is currently just an escape for `R` without the `u` flag.\n\n\u003e NOTE: Not supported inside of a character class.\n\n\n\u003c!--#endregion:syntax--\u003e\n\n\u003c!--#region:semantics--\u003e\n# Semantics\n\n- In `u` or `v` mode, `\\R` is roughly equivalent to the following pattern:\n  ```re\n  (?\u003e\\r\\n?|[\\x0A-\\x0C\\x85\\u{2028}\\u{2029}])\n  ```\n  - Aligns with `^` and `$` in `mu` mode\n- When not in `u` or `v` mode, `\\R` will continue to match the literal character `R`.\n\n\u003e NOTE: The above example uses atomic groups `(?\u003e)` to prevent backtracking when matching `\\r\\n?`. Atomic groups is proposed [here](https://github.com/rbuckton/proposal-regexp-atomic-operators).\n\n\u003c!--#endregion:semantics--\u003e\n\n\u003c!--#region:examples--\u003e\n# Examples\n\n```js\n// split lines regardless of line termiantor style\nconst lines = fs.readFileSync(\"file.txt\", \"utf8\").split(/\\R/ug);\n```\n\n\u003c!--#endregion:examples--\u003e\n\n\u003c!--#region:api--\u003e\n\u003c!-- # API --\u003e\n\n\u003c!--#endregion:api--\u003e\n\n\u003c!--#region:grammar--\u003e\n\u003c!-- # Grammar\n\n```grammarkdown\n``` --\u003e\n\u003c!--#endregion:grammar--\u003e\n\n\u003c!--#region:references--\u003e\n\u003c!-- # References\n\n\u003e TODO: Provide links to other specifications, etc.\n\n* [Title](url)   --\u003e\n\u003c!--#endregion:references--\u003e\n\n# History\n\n- October 28, 2021 \u0026mdash; Proposed for Stage 1 ([slides](https://1drv.ms/p/s!AjgWTO11Fk-TkfoQmhSpEYYM0spVqg?e=zsP6g4))\n  - Outcome: Advanced to Stage 1\n\n\u003c!--#region:todo--\u003e\n# TODO\n\nThe following is a high-level list of tasks to progress through each stage of the [TC39 proposal process](https://tc39.github.io/process-document/):\n\n### Stage 1 Entrance Criteria\n\n* [x] Identified a \"[champion][Champion]\" who will advance the addition.  \n* [x] [Prose][Prose] outlining the problem or need and the general shape of a solution.  \n* [x] Illustrative [examples][Examples] of usage.  \n* [ ] ~~High-level [API][API].~~  \n\n### Stage 2 Entrance Criteria\n\n* [x] [Initial specification text][Specification].  \n* [ ] ~~[Transpiler support][Transpiler] (_Optional_).~~  \n\n### Stage 3 Entrance Criteria\n\n* [ ] [Complete specification text][Specification].  \n* [ ] Designated reviewers have [signed off][Stage3ReviewerSignOff] on the current spec text.  \n* [ ] The ECMAScript editor has [signed off][Stage3EditorSignOff] on the current spec text.  \n\n### Stage 4 Entrance Criteria\n\n* [ ] [Test262](https://github.com/tc39/test262) acceptance tests have been written for mainline usage scenarios and [merged][Test262PullRequest].  \n* [ ] Two compatible implementations which pass the acceptance tests: [\\[1\\]][Implementation1], [\\[2\\]][Implementation2].  \n* [ ] A [pull request][Ecma262PullRequest] has been sent to tc39/ecma262 with the integrated spec text.  \n* [ ] The ECMAScript editor has signed off on the [pull request][Ecma262PullRequest].  \n\u003c!--#endregion:todo--\u003e\n\n\u003c!-- The following links are used throughout the README: --\u003e\n\n[Process]: https://tc39.es/process-document/\n[Proposals]: https://github.com/tc39/proposals/\n[Grammarkdown]: http://github.com/rbuckton/grammarkdown#readme\n[Champion]: #status\n[Prose]: #motivations\n[Examples]: #examples\n[API]: #api\n[Specification]: https://tc39.es/proposal-regexp-r-escape\n\n[Transpiler]: #todo\n[Stage3ReviewerSignOff]: #todo\n[Stage3EditorSignOff]: #todo\n[Test262PullRequest]: #todo\n[Implementation1]: #todo\n[Implementation2]: #todo\n[Ecma262PullRequest]: #todo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftc39%2Fproposal-regexp-r-escape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftc39%2Fproposal-regexp-r-escape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftc39%2Fproposal-regexp-r-escape/lists"}