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

  • SEARCH
  • Home
  • 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 1002397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:49:36+00:00 2026-05-16T07:49:36+00:00

I am running a split in javascript with /\s+(AND|OR)(?=\s+)\s+/ on email IS NOT NULL

  • 0

I am running a split in javascript with /\s+(AND|OR)(?=\s+")\s+/ on

"email" IS NOT NULL AND "email" LIKE '%gmail.com' OR "email" = 'test@test.com'

Now, my understanding of regular expressions would lead me to expect obtaining the following array:

[0]: "email" IS NOT NULL
[1]: "email" LIKE '%gmail.com'
[2]: "email" = 'test@test.com'

Note: I got rid of the delimiters for clarity.

However, I obtain

[0]: "email" IS NOT NULL
[1]:  AND
[2]: "email" LIKE '%gmail.com'
[3]:  OR
[4]: "email" = 'test@test.com'

when running on Firefox 3.6.8, Chrome 5.0.375.126 and Safari 5.0.1 on OS X 10.6.4.

However, when I tried on an up to date IE8 8.0.6 with default settings and I obtain what I was expecting at first. PHP 5.2.10 with preg_split does also split it this way.

My guess is that for once the ‘good’ browsers got it wrong but I’d like more opinions.

Edit: The example I gave here with emails is a naive example. Basically I don’t know what each member can be. "xyz" = '1' AND "zyx" = 'test AND toast' is another possible input string.

What I know of the structure is that the whole string will have the following pattern:

"<attribute>" <operator> '<value>'( (AND|OR) "<attribute>" <operator> '<value>')*

Note: spaces actually represent \s+

  • 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-05-16T07:49:37+00:00Added an answer on May 16, 2026 at 7:49 am

    It looks like Firefox and Chrome got it perfectly right, since according to the specs of ECMAScriptv5 section 15.5.4.14

    If separator is a regular expression
    that contains capturing parentheses,
    then each time separator is matched
    the results (including any undefined
    results) of the capturing parentheses
    are spliced into the output array.

    For example,

    "A<B>bold</B>and<CODE>coded</CODE>".split(/<(\/)?([^<>]+)>/)
    

    evaluates to the array

    [“A”, undefined, “B”, “bold”, “/”,
    “B”, “and”, undefined,
    “CODE”, “coded”, “/”, “CODE”, “”]

    Pointer to the specs by Chris Leary of Mozilla.

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

Sidebar

Ask A Question

Stats

  • Questions 505k
  • Answers 505k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It works relatively well, however, if the bot creator caters… May 16, 2026 at 3:25 pm
  • Editorial Team
    Editorial Team added an answer You cannot "move" an array. You can move a pointer… May 16, 2026 at 3:25 pm
  • Editorial Team
    Editorial Team added an answer The last three headers are with http/1.0. So no case… May 16, 2026 at 3:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm running the CMS indexhibit, indexhibit uses an iframe to load it's content. http://www.therussianfrostfarmers.com/
I am processing CSV File Say ABC|06|001 PPP|06|001 I am running LINQ to split
I have a split view app running fine on the iPad. It is using
I'm playing around with jQuery tabs and have a prototype up and running. http://www.omnicom-innovations.com/play/tabsdemo.html
I have a long-running report and want to show a wait-spinner to the user
I need to split a string similar to a path, which is delimited by
I am not sure if it does or does not. Some sites show using
I've got a CakePHP install running six different web sites, each with their own
i have some project, which can be running on databases with different names. I
Say I have something like the following: dest = \n.join( [line for line in

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.