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 ERROR #598

Open
2 tasks done
josephshenjs opened this issue Jul 14, 2023 · 0 comments
Open
2 tasks done

SyntaxError: Invalid regular expression ERROR #598

josephshenjs opened this issue Jul 14, 2023 · 0 comments

Comments

@josephshenjs
Copy link

Verify latest release

  • I verified that the issue exists in the latest chatgpt release

Verify webapp is working

  • I verify that the ChatGPT webapp is working properly for this account.

Environment details

Node.js v18.16.0

Describe the Bug

I am not able to run a simple example. Anyone can help?

const regexes = new RegExp(this.patStr, "ug");
^

SyntaxError: Invalid regular expression: /('s|'S|'t|'T|'re|'rE|'Re|'RE|'ve|'vE|'Ve|'VE|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]|\s[\r\n]+|\s+(?!\S)|\s+/: Invalid property name in character class
at new RegExp ()
at _Tiktoken.encode (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/js-tiktoken/dist/chunk-THGZSONF.js:76:21)
at encode (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/build/index.js:11:36)
at ChatGPTAPI._getTokenCount (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/build/index.js:458:12)
at ChatGPTAPI._buildMessages (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/build/index.js:422:48)
at ChatGPTAPI.sendMessage (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/build/index.js:226:59)
at CAC. (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/bin/cli.js:97:29)
at CAC.runMatchedCommand (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/cac/dist/index.mjs:610:34)
at CAC.parse (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/cac/dist/index.mjs:537:12)
at main (file:///home/jo/.npm/_npx/060caca6003d4dba/node_modules/chatgpt/bin/cli.js:130:9)

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

1 participant