BASH Palindrome Checker

前端 未结 5 1916
[愿得一人]
[愿得一人] 2021-01-24 19:14

This is my first time posting on here so bear with me please.

I received a bash assignment but my professor is completely unhelpful and so are his notes.

Our assig

5条回答
  •  无人及你
    2021-01-24 19:36

    Another solution that uses a Perl-compatible regular expressions (PCRE) with recursion, heavily inspired by this answer:

    grep -P '^(?:([a-z])(?=[a-z]*(\1(?(2)\2))$))++[a-z]?\2?$' /usr/share/dict/words
    

提交回复
热议问题