- or download this
($txt = '123abc') =~ /(a|b|c)/;
...
- check for c -> fail
4. 123^abc - check for a -> succeess, $1 becomes 'a'
- or download this
($txt = 'barefoot') =~ /(foo|foot)/;
...
- check for foot -> fail
5. bare^foot - check for foo -> success, $1 becomes 'foo'
- or download this
($txt = 'arvec') =~ /(ar|ec|vec)$/
...
3. ar^vec - check for ar$ -> fail
- check for ec$ -> fail
- check for vec$ -> success, $1 becomes 'vec'