Regex expression with leading zero
Posted
by
user1874087
on Stack Overflow
See other posts from Stack Overflow
or by user1874087
Published on 2012-12-03T23:29:06Z
Indexed on
2012/12/04
11:08 UTC
Read the original article
Hit count: 233
regex
I'm rather new to regex expressions and need help with a simple expression. I'm using Pentaho for ETL (Replace in String transformation) and I have column values that I need to add leading zeros to and parse out text as part of the database import. So far I have been unable to add the leading zero.
The column is called Region and the values are "region 8", "region 10", "region 11". My regex expression is ['Region'] which will eliminate the region text but produces results = "8", "10", "11". I need values to produce "08", "10", "11". So all the single digit numbers must have leading zeros.
© Stack Overflow or respective owner