8051Enthusiast/regex2fat

Did you ever want to match a regex, but all you had was a fat32 driver? Ever wanted to serialize your regex DFAs into one of the most widely...
8051Enthusiast/regex2fat

Did you ever want to compare a regex, but all you had was a corpulent32 driver?
Ever desired to serialize your regex DFAs into surely some of the broadly supported formats outdated vogue by over 3 billion gadgets?
Are directory loops your ingredient?

Fear no more, with regex2fat this has become more uncomplicated than ever sooner than!
With gorgeous a dinky of regex2fat '[YOUR] F{4}VOUR{1,7}E (R[^E]G)*EX HERE.' /dev/whatever, you beget a corpulent32 regex DFA of your favourite regex.
As an illustration, to beget a examine whether or now not the string 'Y FFFFVOURRE EX HEREM' would match, gorgeous mount it and take a look at if '/Y/SPACE/F/F/F/F/V/O/U/R/R/E/SPACE/E/X/SPACE/H/E/R/E/M/MATCH' exists.

To high-tail it, you shall be in a location to install cargo after which high-tail cargo install regex2fat (or compile it straight from this repo).
If you happen to’ve got the cargo bin directory in your direction, you wish so to invoke it admire described above.
The file created will doubtless be a corpulent32 image, which may potentially be mounted or put on a force by some capacity, but doubtless have to now not.

FAQ

Q: How does this work?

A: Fashioned regexes (i.e. no backreferences and identical evolved aspects) is also grew to become right into a so known as DFA (deterministic disclose automaton).
Here is de facto a bunch of arrows going between states, the set apart an arrow is labeled with a letter in assert that a letter in a disclose causes the present disclose to walk along the arrow to one other disclose, with a subset of states being accepting.
Optimistic, I’m unhealthy at explaining, you are greater off learning the wikipedia article on DFAs if you develop now not know what it is.

Because I’m slothful, I outdated vogue BurntSushi/regex-automata to safe an DFA from a regex.

While Elephantine32 in total has a tree-admire structure, every directory gorgeous references blocks anyplace on the file procedure, so the same block is also referenced from a pair of directories.
The directories also don’t beget any explicit field for father or mother directories, so one can leave .. out.
This lets in for graph constructions within a file procedure, which a DFA most continuously is.

Q: Could doubtless unruffled I utilize this in manufacturing anyplace?

A: No, but I’m in a position to now not discontinuance you.

Q: Does this in actuality work?

A: I’ve tried it on Home windows 10 and Linux up to now.
It appears to be like to work flawlessly on Home windows as some distance as I’ve examined.

On Linux, the corpulent32 code claims an directory is invalid if there are two dentries with the same directory title and the same father or mother in a loop (or something admire that), so some paths are forbidden.

Could doubtless very properly be fun to beget a examine out on some embedded gadgets.

Q: NOOOOOOOOOOO!!! YOU CAN’T TURN A DFA INTO A FAT32 FILE SYSTEM!!!! YOU CAN’T JUST HAVE A DIRECTORY WITH MULTIPLE PARENTS!!! YOU ARE BREAKING THE ASSUMPTION OF LACK OF LOOPERINOS NOOOOOOOOO

A: Haha OS-driven regex engine walk brrrrr

Read More

Categories
Internet of Things
No Comment

Leave a Reply

*

*

RELATED BY