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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:54:33+00:00 2026-06-14T19:54:33+00:00

I have the following input elements: <input id=AAA_RandomString_BBB type=text /> <input id=AAA_RandomString_BBB_Start type=text />

  • 0

I have the following input elements:

<input id="AAA_RandomString_BBB" type="text" />
<input id="AAA_RandomString_BBB_Start" type="text" />
<input id="AAA_RandomString_BBB_End" type="text" />

AAA & BBB are constants and I will always know what they are. However RandomString will always be random.

I want to get the value of AAA_RandomString_BBB. I do not want the values from the input elements with ID ending in either _Start or _End.

I tried the folowing:

$('[id^="AAA_"]')

But the above selects all of the input elements that have an ID starting with “AAA_”

I need some way to select using a regex type syntax like:

$('[id^="AAA_(.+?)_BBB"]')

Is this possible? If not, can anyone suggest a method of selecting

  • 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-14T19:54:34+00:00Added an answer on June 14, 2026 at 7:54 pm

    You can combine both selectors in a multiple attribute selector.

    ​$("[id^=AAA_][id$=_BBB]")
    

    It will return all the elements that matches all the specified attribute filters:

    • [id^=AAA_] matches elements with id attribute starting with AAA_, and
    • [id$=_BBB] matches elements with id attribute ending with _BBB.

    Another generic alternatives:

    • Using a custom :regex() selector,
    • Using a .filter()-based approach.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following HTML with two elements having the same name <input type=hidden name=
I have the following HTML <input type=text name=first expression=firstExpression/> <input type=text name=last expression=secondExpression/> <input
I have the following: <script type=text/javascript> $(document).ready(function () { $(input[id^='Position_'], select[id^='Level_'], input[id^='Title_'], select[id^='Status_'],).change(function (e)
I have the following input XML: <root age=1> <description>some text</description> <section> <item name=a> <uuid>1</uuid>
I have the following text input on a budget calculator form which displays the
I have the following HTML: <input id=upload1 type=file /><br/> <input id=upload2 type=file /><br/> <input
I want to write a selector which will select 1. Input elements of type
I have the following HTML element: <input type=checkbox name=ctl00$ContentPH$ucFuncionEdit1$ckEsMenu /> How can I select
The page has the following CSS: input[type=text] { display: inline; padding: 7px; background-color: #f6f6f6;
What if I have 2 forms on 1 page: <form id=form1> <input type=text />

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.