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

Regular Expression Invalid #80

Open
arunattupurath opened this issue Nov 3, 2019 · 1 comment
Open

Regular Expression Invalid #80

arunattupurath opened this issue Nov 3, 2019 · 1 comment

Comments

@arunattupurath
Copy link

Mockserver serving mocks {verbose:true} under "mockapi" at http://localhost:8080 Reading from mockapi\trials\GET.mock file: Matched C:\Users\arunn3\AppData\Roaming\npm\node_modules\mockserver\mockserver.js:17 const regex = /(?<=HTTP\/\d.\d\s{1,1})(\d{3,3})(?=[a-z0-9\s]+)/gi; ^

SyntaxError: Invalid regular expression: /(?<=HTTP\/\d.\d\s{1,1})(\d{3,3})(?=[a-z0-9\s]+)/: Invalid group at parseStatus (\AppData\Roaming\npm\node_modules\mockserver\mockserver.js:17:17) at Monad.map (\AppData\Roaming\npm\node_modules\mockserver\monad.js:4:25) at parse (\AppData\Roaming\npm\node_modules\mockserver\mockserver.js:85:6) at (\AppData\Roaming\npm\node_modules\mockserver\mockserver.js:389:22 at IncomingMessage.<anonymous> (\AppData\Roaming\npm\node_modules\mockserver\mockserver.js:281: 5) at emitNone (events.js:106:13) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1056:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

I tried the regular expression /(?<=HTTP/\d.\d\s{1,1})(\d{3,3})(?=[a-z0-9\s]+)/gi and it works ; the mock content I used is as below :
HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 { "Random": "content" }

What is wrong here ???

@pkoretic
Copy link

pkoretic commented Apr 9, 2020

Probably related to older Node.js version, had same case, issue with 8x but works ok with latest Node.

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

2 participants