Code Monkey home page Code Monkey logo

Comments (3)

MagicalTux avatar MagicalTux commented on July 19, 2024 1

After a lot of research, it turns out most uses of PHP's preg_* methods are compatible with re2/golang's own regexp engine.

Conclusion: creating a "re2" ext that exposes golang's regexp engine and also weak (ie. overridable) preg_* methods should allow most PHP apps to work, and might even result in a security improvement as re2's linear time execution isn't subject to the class of attacks abusing pcre features.

from goro.

MagicalTux avatar MagicalTux commented on July 19, 2024

This looks interesting, but might be difficult to keep up to date (will depend on maintainer), also I see it uses a lot of unsafe.Pointer (I guess because of c2go), and running go test resulted in a crash ("fatal error: sweep increased allocation count" the second time, first time was about cgo and pointers).

I'm guessing this is not exactly production ready yet, but will definitely keep an eye on this.

from goro.

ww9 avatar ww9 commented on July 19, 2024

+1 for avoiding cgo whenever possible. Most apps dont rely heavily on regex so even if the pure go implementation is slower, it shouldnt matter.

I glanced over my old PHP projects and all of them use regex that's either compatible or can easily be translated to go's regex.

I think this is great!

from goro.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.