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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:37:48+00:00 2026-05-15T13:37:48+00:00

jquery says: http://docs.jquery.com/JQuery_Core_Style_Guidelines#RegExp All RegExp operations should be done using .test() and .exec(). string.match()

  • 0

jquery says:
http://docs.jquery.com/JQuery_Core_Style_Guidelines#RegExp

All RegExp operations should be done
using .test() and .exec().
“string”.match() is no longer used.

Why is .match() not recommended?

  • 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-15T13:37:49+00:00Added an answer on May 15, 2026 at 1:37 pm

    A major benefit of exec is that it returns capturing groups. For example:

    var s = "123456789"
    var regex = /.(.)(..)/g;
    

    match:

    s.match(regex);
    > [1234, 5678]
    

    exec:

    regex.exec(s);
    > [1234, 2, 34]
    regex.exec(s);
    > [5678, 6, 78]
    

    Reviewing the coding standards you’ve posted; the document contains many seemingly arbitrary guidelines. Obviously, it aims to achieve mostly consistency, so it is possible exec is preferred because it has more functionality – it has to be used on some occasions, so they might as well use it always.

    On a personal note, I don’t care much for guidelines without explanations, so it’s a good thing you’ve asked. In many cases it leads to dogmatic or superstition-based programming.

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

Sidebar

Related Questions

Form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Test url: http://docs.jquery.com/Plugins/Validation How to reproduce: 1.) Click on the
I'm using jquery validation ( http://docs.jquery.com/Plugins/Validation ) like so: var $__field = $(#selector); if
reading the docs here:http://grails.org/plugin/jquery-ui it says to use a custom theme I should put
In the jQuery UI datepicker Docs ( http://jqueryui.com/demos/datepicker/ ) it says you can change
In the jQuery docs for the load event http://api.jquery.com/load-event/ , it says Can cease
In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says // Add
for example here in documentation http://api.jquery.com/attribute-contains-selector/ it says $('input[name*=man]') I would write instead $(input[name*='man'])
I'm using http://isotope.metafizzy.co/docs/options.html#onlayout and it says this: Similiar to a callback, onLayout is a
Im trying to implement an asp.net textbox using the jQuery UI Autocomplete widget http://jqueryui.com/demos/autocomplete/#remote
im following the railscasts using jquery tokeninput http://railscasts.com/episodes/258-token-fields-revised in creating autocomplete tag tokens 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.