Git Product home page Git Product logo

Comments (1)

jayvdb avatar jayvdb commented on May 3, 2024

It is worth stepping back and trying to establish what the user wants with Unicode support in the context of expanding a regex.

Even something fairly constrained like \w{3} in Unicode mode becomes a large sequence, putting pressure on memory if the developer isnt careful. I suspect the use cases for that are quite limited, and the developer is likely going to need to aggressively thin out the results. They would rather declarative have the results pre-thinned, so IMO usable Unicode support is highly dependent on #2. Technically supporting Unicode without good thinning mechanisms seems like a self-knockout given that Unicode support is likely to hurt CI build times significantly, and development time, and possibly even cause headaches in future enhancements. All those negatives are worth the pain if the users have a usable feature.

Likewise \d will often want to be expanded to only one numeral system.

In pywikibot there is quite a lot of code and use-cases to switch languages and switch numeral systems, especially to work in different calendar systems, and needing to mix natural and numerical strings, such as building generators of all century names (e.g. "3rd century BCE") and do that for each locale of Wikipedia, and build algorithms on top which work for any subdomain of Wikipedia. Those generators could easily be built using sre_yield, and I recall we had a few hacky attempts at similar approaches in the codebase. The need to mix numbers and natural language lends itself to having mappings of expandable regexes with keys for language codes.
No doubt I am forgetting some use case for mixing almost random parts of Unicode in the one algorithm, but all the ones which come to mind are like that -- they are generic algorithms that sit on swappable pre-defined segments of Unicode.

from sre_yield.

Related Issues (20)

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.