in reply to Re^7: reg expression question
in thread reg expression question
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: reg expression question
by healingtao (Novice) on Jan 29, 2015 at 18:13 UTC |