Linux Bash Script Regex malfunction
<p>I would like to make a bash script, which should decide about the given strings, if they fulfill the term or not.</p>

<p>The terms are:</p>

<ul>
<li>The string's first 3 character must be "le-"</li>
<li>Between hyphens there can any number of consonant in any arrangement, just one "e" and it cannot contain any vowel.</li>
<li>Between hyphens there must be something</li>
<li>The string must not end with hyphen</li>
</ul>

<p>I made this script:</p>

<pre><code>#!/bin/bash
# Testing regex

while read -r line; do
        if [[ $line =~ ^le((-[^aeiou\W]*e+[^aeiou\W]*)+)$ ]]
        then
           printf "\""$line"\"\t\t\t-&gt; True\n";
        else
           printf "\""$line"\"\t\t\t-&gt; False\n";
        fi
done &lt; &lt;(cat "$@")
</code></pre>

<p>It does everything fine, except one thing:
It says true no matter how many hyphens are next to each other.
For example:
It says true for this string "le--le"</p>

<p>I tried this regex expression on websites (like <a href="https://regex101.com/r/gL6hE3/1" rel="nofollow">this</a>) and they worked without this malfunction.
All I can think of there must be something difference between the web page and the linux bash. (All I can see on the web page is it runs PHP)</p>

<p>Do you have got any idea, how could I make it work ?</p>

<p>Thank you for your answers!</p>