Guidance > Exercise Notes > Reasonable Solutions
Possibly out of sync due to newer test with apostrophies :
- declare -ra WORDS=( ${1//[![:alpha:]]/ } )
+ declare -ra WORDS=( ${1//[!\'[:alpha:]]/ } )
Possibly out of sync due to newer test with apostrophies :
- declare -ra WORDS=( ${1//[![:alpha:]]/ } )
+ declare -ra WORDS=( ${1//[!\'[:alpha:]]/ } )
Want to send a PR for that?
Hmm, while we’re in there, I would question this as a reasonable solution:
IFS=' !"#$%&()*+,-./:;<=>?@[\]^_`{|}~';
Looks like there’s a missing double escaping of an apostrophy later on too – I think it may need it due to markdown :
- 1) words=${1//[!\'[:alpha:]]/ };
+ 1) words=${1//[!\\'[:alpha:]]/ };
Because it renders without the backslash \
: