www.webdeveloper.com
Results 1 to 3 of 3

Thread: Help with matching

  1. #1
    Join Date
    Jun 2014
    Posts
    2

    Help with matching

    newbee needs help with matching.

    GLOBAL_ShippingAddress:
    John Smith
    The Smith Company
    18815 Main St
    Beaverton, Oregon 97006
    United States

    javascript:
    var FullAddress = "%%GLOBAL_ShippingAddress%%";
    var matches = FullAddress.match(/[^0-9]([0-9]{5})/);
    document.write('matches: '+ matches + '<br>');

    output:
    matches: 90291,90291

    I need the output to be 90291

    I have no idea how to alter the FullAddress.match(/[^0-9]([0-9]{5})/); to output just one zip code, any help would be appriciated.

    Thanks,

  2. #2
    Join Date
    Jun 2014
    Posts
    2
    Correction- output:
    matches: 97006,97006

    I need the output to be 97006

  3. #3
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,773

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles