Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add RegExp Unicode Property Escapes to intl #19052

Closed
wants to merge 1 commit into from
Closed

doc: add RegExp Unicode Property Escapes to intl #19052

wants to merge 1 commit into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Feb 28, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc, intl

RegExp Unicode Property Escapes are at stage 4 and will be included in ES2018. They are available since V8 6.4 without a flag so they will be unflagged in Node.js v10. They are also available under the --harmony_regexp_property flag in Node.js v6-v9 and under the --harmony flag in Node.js v8-v9.

So it seems we should already warn about this and maybe backport these notes till v6 LTS.

Simple test:

> node.10.0.0.v8-6.4.20180227.nightly.exe

> process.versions

{ http_parser: '2.7.0',
  node: '10.0.0-nightly20180227a27e6d7321',
  v8: '6.4.388.46-node.4',
  uv: '1.19.2',
  zlib: '1.2.11',
  ares: '1.13.0',
  modules: '61',
  nghttp2: '1.29.0',
  napi: '2',
  openssl: '1.0.2n',
  icu: '60.2',
  unicode: '10.0',
  cldr: '32.0.1',
  tz: '2017c' }

> 'abc абв'.match(/\p{Letter}+/gu);

[ 'abc', 'абв' ]

'abc абв'.match(/\p{Script=Cyrillic}+/gu);

[ 'абв' ]
> .\vcbuild without-intl test

...

> node.10.0.0-pre.v8-6.4.20180228.without-intl.exe

> process.versions

{ http_parser: '2.7.0',
  node: '10.0.0-pre',
  v8: '6.4.388.46-node.4',
  uv: '1.19.2',
  zlib: '1.2.11',
  ares: '1.13.0',
  modules: '61',
  nghttp2: '1.29.0',
  napi: '2',
  openssl: '1.0.2n' }

> 'abc абв'.match(/\p{Letter}+/gu);

SyntaxError: Invalid regular expression: /\p{Letter}+/: Invalid property name

> 'abc абв'.match(/\p{Script=Cyrillic}+/gu);

SyntaxError: Invalid regular expression: /\p{Script=Cyrillic}+/: Invalid property name

I am not sure if this suffices to state full support also for system-icu, please check and correct me if this is needed.

Additional refs:

https://mathiasbynens.be/notes/es-unicode-property-escapes
https://mathiasbynens.be/notes/es-regexp-proposals#unicode-property-escapes

http://exploringjs.com/es2018-es2019/ch_regexp-unicode-property-escapes.html

https://ponyfoo.com/articles/regular-expressions-post-es6#unicode-property-escapes

Unfortunately, still no info in MDN RegExp page to link to.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. i18n-api Issues and PRs related to the i18n implementation. labels Feb 28, 2018
@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Feb 28, 2018

@vsemozhetbyt vsemozhetbyt added the v8 engine Issues and PRs related to the V8 dependency. label Feb 28, 2018
@BridgeAR BridgeAR added fast-track PRs that do not need to wait for 48 hours to land. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 1, 2018
vsemozhetbyt added a commit that referenced this pull request Mar 2, 2018
PR-URL: #19052
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@vsemozhetbyt
Copy link
Contributor Author

Landed in d3af120

@vsemozhetbyt vsemozhetbyt deleted the doc-intl-re-uni-prop branch March 2, 2018 00:39
addaleax pushed a commit to addaleax/node that referenced this pull request Mar 5, 2018
PR-URL: nodejs#19052
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 6, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#19052
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
jasnell pushed a commit to jasnell/node that referenced this pull request Aug 17, 2018
PR-URL: nodejs#19052
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 6, 2018
Backport-PR-URL: #22380
PR-URL: #19052
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land. i18n-api Issues and PRs related to the i18n implementation. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants