question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Invalid regular expression

See original GitHub issue

What happened

$ react-native init test
$ cd test
$ react-native-rename "Travel App"
Something went wrong:  SyntaxError: Invalid regular expression: /^([\p{Letter}\p{Number}])+([\p{Letter}\p{Number}\s]+)$/: Invalid escape
    at new RegExp (<anonymous>)
    at Command.<anonymous> (/Users/work/.nvm/versions/node/v8.11.1/lib/node_modules/react-native-rename/lib/index.js:120:19)
    at Command.listener (/Users/work/.nvm/versions/node/v8.11.1/lib/node_modules/react-native-rename/node_modules/commander/index.js:315:8)
    at emitOne (events.js:116:13)
    at Command.emit (events.js:211:7)
    at Command.parseArgs (/Users/work/.nvm/versions/node/v8.11.1/lib/node_modules/react-native-rename/node_modules/commander/index.js:656:12)
    at Command.parse (/Users/work/.nvm/versions/node/v8.11.1/lib/node_modules/react-native-rename/node_modules/commander/index.js:474:21)
    at /Users/work/.nvm/versions/node/v8.11.1/lib/node_modules/react-native-rename/lib/index.js:315:6
    at <anonymous>

react-native info

  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: x64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
      Memory: 686.64 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
      react-native: 0.57.4 => 0.57.4
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
      react-native-rename: 2.3.1
      svg-to-react-native-cli: 0.0.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:15

github_iconTop GitHub Comments

12reactions
91ayushcommented, Nov 2, 2018

Same here

2reactions
azizimusacommented, Nov 7, 2018

Use version 2.2.2 guys…

npm uninstall react-native-rename -g npm install react-native-rename@2.2.2 -g

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript syntax error: invalid regular expression
Match returns js error - Uncaught SyntaxError: Invalid regular expression: /sel\/: \ at end of pattern. Is there any way to check whether...
Read more >
SyntaxError: invalid regular expression flag "x" - JavaScript
The JavaScript exception "invalid regular expression flag" occurs when the flags, defined after the second slash in regular expression literal, ...
Read more >
JavaScript SyntaxError - Invalid regular expression flag "x"
This JavaScript exception invalid regular expression flag occurs if the flags, written after the second slash in RegExp literal, are not from ...
Read more >
How to Fix 'Nothing to repeat' Errors in JavaScript - Webtips
The "Uncaught SyntaxError: Invalid regular expression: Nothing to repeat" error occurs in JavaScript when your regular expression is not ...
Read more >
SyntaxError: invalid regular expression flag "x"
There are invalid regular expression flags in the code. In a regular expression literal, which consists of a pattern enclosed between slashes, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found