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 7819589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:00:37+00:00 2026-06-02T07:00:37+00:00

I am running some JavaScript code in Firefox that doesn’t seem to be following

  • 0

I am running some JavaScript code in Firefox that doesn’t seem to be following the rules of regular expressions. I am trying to split up a String of coordinates, which has some funky whitespace in it, like so:

-117.2967917,35.5189858 -117.2966678,35.5189526

-117.296678,35.5187657 -117.2968027,35.5187999

-117.2967917,35.5189858 

I know that the regex \s is supposed to match all spacing, so I used \s+ to split my string in RegexPal, which worked great, as you can see below:

But for some reason when I run my JavaScript code with this regex, I get a one-element array with the entire String in it. This is my code:

var coordArray = polygonString.split("\s+");

I’ve tried several different regular expressions, but the split function in my JavaScript doesn’t seem to be behaving like it should. It does not yield the same results at RegexPal. Why is this? What am I missing?

  • 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-02T07:00:38+00:00Added an answer on June 2, 2026 at 7:00 am

    Use:

    var coordArray = polygonString.split(/\s+/);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
I'm having problems with debugging DOM changes introduced by some JavaScript code I'm running.
I have an iFrame that is running some Javascript and I want the iFrame
I'm running some code through JSHint and I keep getting the following error: Don't
I would like to have some Javascript code running in a web browser write
I am trying to run some acceptance tests for javascript code. However, when I
I'm running some tests comparing the sha1 algorithm implemented in javascript - got from
For some reason, in IE8, javascript is not running unless I reload the page
I'm running some code through FxCop and am currently looking at clearing all of
I am running some import code asynchronously from a simple WinForms app using a

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.