firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.28k stars 199 forks source link

pcrelib.js and pcreworker.js #1535

Closed john5634 closed 3 years ago

john5634 commented 3 years ago

Question

Hi Firas! @firasdib

So I'm working on a project that needs PCRE regex done in browser. I stumbled upon your offline version of regex101, and saw that pcrelib.js and pcreworker.js does a very nice job at that!!

Can you assign the MIT license ONLY to the pcrelib.js and pcreworker.js file that included in the offline version of regex101? We tried writing it from scratch but weren't sure where to start.

If you aren't willing to assign a license to pcrelib.js and, pcreworker.js, could you point us in the right direction to accomplishing the same task?

Did you write C code that uses a PCRE (pcre.c) library that you then compiled with Emscripten?

For that code would the parameters simply be: String ,Regex Into the wsm compiled code, then Matches are sent out to JavaScript as an array of objects?

On a side note, awesome work with REGEX101! I use the site every day!!! freaking awesome!

Thanks for your time!

firasdib commented 3 years ago

Hi @john5634

There is no offline version of regex101 that I distribute, anything you find is created (with or without my permission) by someone else.

I recommend you compile your own engine so it works the way you expect and want it to. You are correct regarding emscripten, that is what I used to make it possible for regex101. Alternatively, you can look at precompiled alternatives in the wild. A quick google gave me https://github.com/stephen-riley/pcre2-wasm - what might be something you can use?

Good luck!

john5634 commented 3 years ago

Hi Firas! @firasdib

Hit a wall here, got emscripten to compile perfectly for 8 bit, and 16 bit. But when I hand the 16 bit compiled code text that is utf8 it barfs.

Did you convert everything to 16 bit? or something else?

Thank you in advance!!!