-3

I need to extract a postcode from a string which is ,10, MADE UP STREET, , , MADE UP TOWN, MADE UP COUNTY, A7 , 4AB

The postcode being at the end of the string. I have the regex to extract if for example the postcode is in the format A7 4AB which is just a white space but unsure as to how to extract it with a space comma space. Any help would be massively appreciated

LeonT
  • 1
  • 1
  • What regex tool or language are you using? – Tim Biegeleisen Jul 13 '22 at 12:01
  • Thanks for your reply Tim - I am using the BluePrism automation tool which uses a regex utility VBO which uses C# J# and Visual Basics. I am unable to access stackoverflow on my work machine so I can’t publish the full regex string I am initially using which is slightly annoying – LeonT Jul 13 '22 at 12:11

1 Answers1

0

I'm not exactly sure what regex engine you are using but I don't think that will matter anyway. If you, for example, have your regex set up to extract a postcode in the form A7 4AB like so

.....  (.+)\s(.+)

Then simply do ..... (.+)\s,\s(.+)