9 ms·
Hm I'd go even simpler than that. Notably, I'd not do this: > So the user would enter "first name" into the plugin's search field. Why wouldn't the user just
by skrebbel 2y ago
Hm I'd go even simpler than that. Notably, I'd not do this:
> So the user would enter "first name" into the plugin's search field.
Why wouldn't the user just enter "first_name" or "firstName" or something like that? I'm thinking about situations like, you're looking at backend code that's snake_cased, but you also want it to catch frontend code that's camelCased. So when you search for "first_name" you automagically also match "firstName" (and "FirstName" and "first-name" and so on). I wouldn't personally introduce some convention that adds spaces into the mix, I'd simply convert anything that looks snake/kebab/pascal/camel-cased into a regex that matches all 4 forms.
Could even be as stupid as converting "first_name" or "firstName", or "FirstName" etc into "first_name|firstname|first-name", no character classes needed. That catches pretty much every naming convention right? (assuming it's searched for with case insensitivity)
- specialist 2y ago> "first_name" or "firstName" Ya. Query tokenizer would emit "first" and "name" for both. That'd be neat.