Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to convert input to valid UK postcode format

490959May 2 2011 — edited May 18 2011
I want to take a users input and convert it to a valid UK postcode format. Specifically, I want to add in a space in the relevant position, if they have not entered it.

so "G13NU" would be converted to "G1 3NU"

The valid postcode formats are

A0 0AA eg G1 3NU
A00 0AA
A0A 0AA
AA0 0AA
AA00 0AA
AA0A 0AA

Has anyone done similar before, or have any advice?
This post has been answered by Frank Kulash on May 2 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2011
Added on May 2 2011
12 comments
1,827 views