microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.43k stars 28.62k forks source link

Old version browser not support 'd' in Regexp #226029

Open LinWanCen opened 3 weeks ago

LinWanCen commented 3 weeks ago

https://github.com/microsoft/vscode/blob/c800bf9216ee64bdd87db41b6e6101df1b89e897/src/vs/editor/common/services/findSectionHeaders.ts#L39

https://github.com/microsoft/monaco-editor/issues/4557

TylerLeonhardt commented 3 weeks ago

@LinWanCen can you please mention the browser you're using?

BlackHole1 commented 3 weeks ago

The regular expression causing this issue uses the /d flag, which is implemented in the ES2022 specification. Therefore, if the browser version is lower than the list below, it will not be usable:

CleanShot 2024-08-21 at 11 26 34@2x

  1. tc39: https://github.com/tc39/proposal-regexp-match-indices?tab=readme-ov-file
  2. mdn: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions#advanced_searching_with_flags
LinWanCen commented 3 weeks ago

Can you use other code instead.