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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:39:06+00:00 2026-06-11T21:39:06+00:00

I have the following code: if ($selectInput.data(‘propagate-title’) === ‘yes’) { var m = this.id.match(/^modal_TempRowKey_(\d+)$/);

  • 0

I have the following code:

    if ($selectInput.data('propagate-title') === 'yes') {
        var m = this.id.match(/^modal_TempRowKey_(\d+)$/);
        if (m) {
            $("#modal_Title_" + m[1]).val(title);
        }
    }

Can someone explain what is returned and put into m. Can I just change the code to the following and have it work the same?

    if ($selectInput.data('propagate-title') === 'yes') {
        var m = this.id.match(/^modal_TempRowKey_(\d+)$/)[1];
        if (m) {
            $("#modal_Title_" + m).val(title);
        }
    }
  • 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-11T21:39:07+00:00Added an answer on June 11, 2026 at 9:39 pm

    There is an important difference between the two code fragments. You can not make the change you wish because if there is no match, null will be returned from the match operation, and the result of evaluating

    null[1]
    

    would throw an error, something like

    TypeError: Cannot read property '1' of null
    

    The return value of match is an array if the regex matches, or null if there is no match. Element 0 of the returned array is the whole match, element 1 would be the match within the parenthesis-pair starting with the first (. In the first code fragment, the value m[1] is the digit sequence following "modal_TempRowKey_".

    EDIT: See the link provided by Kyle in the comment to the original question for all the details.

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

Sidebar

Related Questions

I have following code to insert data into GiftCouponPayment table and Payment table. This
I have following code var res = from c in model.Data select new object[]
I have following code for inserting data into database using PDO. It inserts data
I have following code: def whatever(url, data=None): req = urllib2.Request(url) res = urllib2.urlopen(req, data)
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
I have following code snipped: ... var tpc = new ThirtPartyClass(); tpc.ExecuteCommand(); tpc.ExecuteCommand(); ...
i have following code in my php jquery call... <object type=application/x-shockwave-flash data=mysounds/player.swf id=audioplayer1 height=1
I have following code: string date = 13.04.2012; string date2 = (DateTime.Parse(date).AddDays(1)).ToString(); This is
I have following code function Model(onChanged) { this.array = new Array(); this.onChanged = onChanged;
I have following code: canvas=new MembershipFunctionComponent(functions); canvas.setPreferredSize(new Dimension((int)this.getWidth(), (int)this.getHeight())); canvas.addMouseListener(canvas); pane.add(canvas); MembsershipFunctionComponent extends JComponent.

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.