All Projects → 8051Enthusiast → Regex2fat

8051Enthusiast / Regex2fat

Licence: unlicense
Turn your favourite regex into FAT32

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Regex2fat

Trufflehog
Searches through git repositories for high entropy strings and secrets, digging deep into commit history
Stars: ✭ 6,225 (+558.73%)
Mutual labels:  regex
Pihole Regex
Custom regex filter list for use with Pi-hole.
Stars: ✭ 799 (-15.45%)
Mutual labels:  regex
Retest
Command-line regular expression tester
Stars: ✭ 13 (-98.62%)
Mutual labels:  regex
Sketch Find And Replace
Sketch plugin to do a find and replace on text within layers
Stars: ✭ 693 (-26.67%)
Mutual labels:  regex
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (-22.43%)
Mutual labels:  regex
Chr
🔤 Lightweight R package for manipulating [string] characters
Stars: ✭ 18 (-98.1%)
Mutual labels:  regex
Ugrep
🔍NEW ugrep v3.1: ultra fast grep with interactive query UI and fuzzy search: search file systems, source code, text, binary files, archives (cpio/tar/pax/zip), compressed files (gz/Z/bz2/lzma/xz/lz4), documents and more. A faster, user-friendly and compatible grep replacement.
Stars: ✭ 626 (-33.76%)
Mutual labels:  regex
Comby
A tool for structural code search and replace that supports ~every language.
Stars: ✭ 912 (-3.49%)
Mutual labels:  regex
Py regular expressions
Learn Python Regular Expressions step by step from beginner to advanced levels
Stars: ✭ 770 (-18.52%)
Mutual labels:  regex
Whitespace Regex
Regular expression for matching the whitespace in a string.
Stars: ✭ 9 (-99.05%)
Mutual labels:  regex
Ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Stars: ✭ 28,564 (+2922.65%)
Mutual labels:  regex
Learn gnuawk
Example based guide to mastering GNU awk
Stars: ✭ 727 (-23.07%)
Mutual labels:  regex
Shallow Clone
Make a shallow clone of an object, array or primitive.
Stars: ✭ 23 (-97.57%)
Mutual labels:  regex
Sakura
SAKURA Editor (Japanese text editor for MS Windows)
Stars: ✭ 689 (-27.09%)
Mutual labels:  regex
Hyper Match
HyperTerm extension which matches regular expressions with predefined commands
Stars: ✭ 15 (-98.41%)
Mutual labels:  regex
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (-32.17%)
Mutual labels:  regex
Regex Assert Symfony
Common Regex to use with Assert in Symfony's entity
Stars: ✭ 5 (-99.47%)
Mutual labels:  regex
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+3099.89%)
Mutual labels:  regex
Regex
A sane interface for php's built in preg_* functions
Stars: ✭ 909 (-3.81%)
Mutual labels:  regex
Verbalex
A library for creating complex, composable regular expressions with the reader & writer in mind. 🔍
Stars: ✭ 26 (-97.25%)
Mutual labels:  regex

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 supported formats used by over 3 billion devices? Are directory loops your thing?

Worry no more, with regex2fat this has become easier than ever before! With just a little regex2fat '[YOUR] F{4}VOUR{1,7}E (R[^E]G)*EX HERE.' /dev/whatever, you will have a fat32 regex DFA of your favourite regex. For example, to see whether the string 'Y FFFFVOURRE EX HEREM' would match, just mount it and check 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 run it, you can install cargo and then run cargo install regex2fat (or compile it directly from this repo). If you have the cargo bin directory in your path, you should be able to invoke it like described above. The file created will be a fat32 image, which can probably be mounted or put on a drive in some way, but most likely shouldn't.

FAQ

Q: How does this work?

A: Regular regexes (i.e. no backreferences and similar advanced features) can be turned into a so called DFA (deterministic finite automaton). This is basically a bunch of arrows going between states, where an arrow is labeled with a letter so that a letter in a state causes the current state to go along the arrow to another state, with a subset of states being accepting. Yes, I'm bad at explaining, you're better off reading the wikipedia article on DFAs if you don't know what it is.

Because I'm lazy, I used BurntSushi/regex-automata to get an DFA from a regex.

While Fat32 normally has a tree-like structure, each directory just references blocks anywhere on the file system, so the same block can be referenced from multiple directories. The directories also have no explicit field for parent directories, so one can leave .. out. This allows for graph structures inside a file system, which a DFA basically is.

Q: Should I use this in production anywhere?

A: No, but I can't stop you.

Q: Does this actually work?

A: I've tried it on Windows 10 and Linux so far. It seems to work flawlessly on Windows as far as I've tested.

On Linux, the fat32 code claims an directory is invalid if there are two dentries with the same directory name and the same parent in a loop (or something like that), so some paths are forbidden.

Might be fun to try on some embedded devices.

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 go brrrrr

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].