Follow

i just don’t have it in me to write a RegExp engine from scratch, y’all

@LadyKIBI Unfortunately adding on all the modern features to them is a pain. 😞 (At least the DFA conversion isn't *that* bad, if you don't care much about runtime or backreferences or anything that isn't matching a regular language.)

@aschmitz oh actually what i need is a regular expression WITHOUT all the modern features, aside from \p{…} unicode property matching, in Swift, which has a constructor which returns nil on invalid strings, so that if someone tries to use a modern feature it doesn’t get picked up by NSRegularExpression

right now i’m basically just hacking this by doing a bunch of find‐and‐replaces on the input string and then letting NSRegularExpression do the actual regular expression processing, but in an ideal world i would have an engine tailored to my use‐case

(the exact regular expression syntax i need to support is here: <w3.org/TR/xmlschema11-2/#regex>)

@LadyKIBI I don't know what you're trying to build in the end, and I have no burning desire to learn Swift, but that seems relatively approachable, especially if you're not massively concerned about runtime or memory at first. Probably not worth doing right now if you have something that works, but "straightforward" though not "easy".

@aschmitz oh yeah it’s definitely not beyond the realm of possibility, just more work than i want to do at the present moment

(i’m building an incredibly rigorous and obtuse XSD datatypes library for use in RDF applications)

swift is incredibly easy to pick up if you ever do find yourself needing to program in it though; it’s the only statically‐typed language i actually enjoy working in (as consequence of inheriting a lot of things from Objective‐C, without looking like Objective‐C)

Sign in to participate in the conversation
Cybrespace

Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.