[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cmene checker
Found this program in my archives. It checks for valid cmene, and is
probably pretty close to right. The commented-out lines are the regexp
from MediaMOO that I developed first and copied from. I imagine I could do
something slicker with perl these days.
~mark
#!/bin/sh
# 3: nocmen =
#
# "^la%|[aeiouy]la%|^[^a-z.]%|.[^a-z,']%|'$%|[^aeiouy]'%|'[^aeiouy]%![^aeiou]$%
# |[hqw]%|[bdgjvz][cfkpst]%|[cfkpst][bdgjvz]%|%([bcdfgjklmnprstvxz]%)%1%|[cjs
# z][cjsz]%|cx%|kx%|xc%|xk%|mz";
echo -n "$*" | egrep -i \
"^la|[aeiouy]la|^doi|[aeiouy]doi|^[^a-z.]|.[^a-z,']|'\$|[^aeiouy]'|'[^aeiuoy]|[aeiouy]\$|[hqw]|[bdgjvz][cfkpst]|[cfkpst][bdgjvz]|[cjsz][cjsz]|cx|kx|xc|xk|mz" > /dev/null || echo -n "$*" | grep -i '\([bcdfgjklmnprstvxz]\)\1' > /dev/null
q=$?
echo $q
exit $q