#text-search #regex #string-search #string-matching #lazy-evaluation #who #case

bin+lib sm-search

A simple way of searching through text - for people who are too lazy to use Regex

3 releases

0.1.2 Oct 14, 2024
0.1.1 Oct 3, 2024
0.1.0 Sep 28, 2024

#740 in Text processing

Download history 132/week @ 2024-09-23 273/week @ 2024-09-30 13/week @ 2024-10-07 186/week @ 2024-10-14

604 downloads per month

Apache-2.0

28KB
610 lines

SM: Self matching search patterns

Regex are great, but for small casual search operations, they can be pretty annoying. Example: you want to search for the string getID("carl"). First, you need to escape the quotes. Then, you might be unsure if it's getID or getId, so you need case insensitivity. Or maybe it's get_id? Then you end up having to do a lot of edits to your search string to create a nice Regex. SM is optimized for exactly these cases: A lazy developer searching for a code snippet in a messy code base.

Use cargo install sm-search to get the CLI tool. Or add this package with cargo add sm-search to use this as your in your own programs. You can look at src/main.rs as example of how this library can be used.

Dependencies

~5–14MB
~170K SLoC