in reply to Looking for a cleaner regex

Um people dont write clean regex in a oneliner. Then its embedded in shell script. Also people dont write regex for just a list of words.

regex presuf

regex trie

Replies are listed 'Best First'.
Re^2: Looking for a cleaner regex
by k-man (Novice) on Dec 08, 2017 at 11:31 UTC

    It's not just a list of words. It's a generalized regex to recognize standard verb forms in Spanish. That it's embedded in a shell script doesn't negate the fact that it's perl. It is a one liner. You got that much!

      Are you asking for help with shell or regex? Are you honestly editing this regex as presented in a shell script? You know how you got newlines and indenting in your shell script? Your regex is easily 10 times more complex than hilite_tail. You might need it in one line for your shell(doubtfull) but its silly for human to write code/regex without whitespace. Accoreing to your code Spanish verb endings is a static list of 20ish words -- if you think that requires optimization you havent timed it. To speedup what you have Replace guts of hilite_tail with single call to perl that does it.