Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8905247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:20:55+00:00 2026-06-15T02:20:55+00:00

I have a list of post codes which should be excluded from my shipping

  • 0

I have a list of post codes which should be excluded from my shipping methods.

Suppose I have to exclude Scilly Isles, Isle of Man and few others.

For the above 2 areas valid post codes are IM1-IM9, IM86, IM87, IM89. And if it is IM25 or IM85 it is invalid.

I have writtent following expression. But it is returning even it is IM25 or IM 85.

var regex = new Regex("(PO3[0-9]|PO4[0-1]|GY[1-9]|JE[1-5]|IM[1-9]|TR[1-9])");

If I am passing IM85, to my expression it should return false. for IM1-IM9,, IM86, IM87, IM89 it should return true.

Same with TR post codes also. TR1-TR27 is a valid post code. If I give TR28, it should return false.

I am using ‘|’ to seperate multiple patterns. Is that the right way of including multiple patterns in 1 expression.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:20:57+00:00Added an answer on June 15, 2026 at 2:20 am

    I have changed my approach.

    Instead of going for a regular expression which is becoming more complex, I am saving all the excluded outward codes of UK post codes.

    And if any post code contains the particular outward code, excluding the post code from the list.
    Outward codes are in this format

    XX-YYY
    XXX-YYY
    XXXX-YYY
    

    In all above formats, X represents outward code of an UK postcode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a list of posts. i want print some words of post content
I have a dynamic list of items that will be used to POST information
I have list of structure. I want to modify a particular data from the
I have List I want to sort Desc by Priority, which is int and
So I have a text file which has the script of Act 1 from
I have a dropdown list which is populated via a jquery ajax call when
I'm trying to use a list of clients that have been created from my
I have the following code, which should perform the first part of creating a
I'm totally lost :) I have a loop which outputs: POST ITLE POST CONTENT
I'm trying to send post request to web service which have an email and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.