Regular Expressions 101

Replace last two digits of a four digit number with 99

Open Workspace
  • Python
  • Substitution
1

Regular Expression

r"
^(\d\d)\d\d$
"
gm

Description

Replaces the last two digits of any four digit number with 99. Useful for replacing chart of account codes for accounting software mapping functionalities. Helpful for ProPay.

Submitted by Eric Higdon