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

SyntaxError: Invalid regular expression #63

Closed
jeongsd opened this issue Nov 2, 2018 · 15 comments
Closed

SyntaxError: Invalid regular expression #63

jeongsd opened this issue Nov 2, 2018 · 15 comments

Comments

@jeongsd
Copy link

jeongsd commented Nov 2, 2018

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
@91ayush
Copy link

91ayush commented Nov 2, 2018

Same here

@NikhilSaini38
Copy link

Same problem

@jmnsf
Copy link

jmnsf commented Nov 3, 2018

Same here, looks like a regression from fb0445d

@irfabatool2
Copy link

I am getting same error

@zainulhasan
Copy link

Same problem

@tushgup
Copy link

tushgup commented Nov 4, 2018

Same error.

@rendy14s
Copy link

rendy14s commented Nov 5, 2018

same here

@traxx10
Copy link

traxx10 commented Nov 5, 2018

Same here

@efleurine
Copy link

I got the same probleme here the faulty line

const pattern = new RegExp('^([\\p{Letter}\\p{Number}])+([\\p{Letter}\\p{Number}\\s]+)$', 'u');

the Regex is not valid const pattern = new RegExp('^([\\p{Letter}\\p{Number}])+([\\p{Letter}\\p{Number}\\s]+)$', 'u');

@efleurine
Copy link

The problem might be related to @slevithan/xregexp#197

@luisfuertes
Copy link

Any update?

@rendy14s
Copy link

rendy14s commented Nov 7, 2018

@luisfuertes nope

@azizimusa
Copy link

azizimusa commented Nov 7, 2018

Use version 2.2.2 guys..

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

@ajcrites
Copy link
Collaborator

ajcrites commented Nov 7, 2018

Node 10 and 11 (LTS and current versions) support Unicode regular expressions. If you want to use the latest versions, you can run it using Node 10 or 11. Otherwise, install an earlier version (e.g. 2.2.2).

I'll see if I can publish a fix for this, though.

@ajcrites
Copy link
Collaborator

ajcrites commented Nov 7, 2018

Fixed in v2.3.2

@ajcrites ajcrites closed this as completed Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests