Skip to content

Invalid regular expression: invalid group specifier name in Safari #372

@artyom-ivanov

Description

@artyom-ivanov

I found some errors in Safari browser (macos and ios).
This line of code throws an error "SyntaxError: Invalid regular expression: invalid group specifier name".

let segment = this.segments[index];
const variable = segment.match(/(?<={)[$0-9a-zA-Z_]+(?==.*})/g) || []; // Error line

if (segment.includes('**')) {

Safari doesn't support lookbehind yet, I think this is the reason for the error.

Environment details

  • OS: MacOS, iOS
  • Node.js version: 12.18.2
  • npm version: 6.14.5
  • google-gax version: 2.12.0

Steps to reproduce

  1. Open project in Safari on Mac or iOS
  2. Open developer console

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions