Almost; except that PUN VALEY B still isn’t handled correctly. That’s because it doesn’t match the regex, so the if clause isn’t entered and the substitutions are not applied. But if you move the two substitutions from within the if clause to after the else clause — that is, to immediately before the return line — then all the tests pass.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^8: reg expression question
by Athanasius
in thread reg expression question
by healingtao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |