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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:33:38+00:00 2026-06-05T02:33:38+00:00

I have a text string that can be any number of characters that I

  • 0

I have a text string that can be any number of characters that I would like to attach an order number to the end. Then I can pluck off the order number when I need to use it again. Since there’s a possibility that the number is variable length, I would like to do a regular expression that catch’s everything after the = sign in the string ?order_num=

So the whole string would be

"aijfoi aodsifj adofija afdoiajd?order_num=3216545"

I’ve tried to use the online regular expression generator but with no luck. Can someone please help me with extracting the number on the end and putting them into a variable and something to put what comes before the ?order_num=203823 into its own variable.

I’ll post some attempts of my own, but I foresee failure and confusion.

  • 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-05T02:33:42+00:00Added an answer on June 5, 2026 at 2:33 am
    var s = "aijfoi aodsifj adofija afdoiajd?order_num=3216545";
    
    var m = s.match(/([^\?]*)\?order_num=(\d*)/);
    var num = m[2], rest = m[1];
    

    But remember that regular expressions are slow. Use indexOf and substring/slice when you can. For example:

    var p = s.indexOf("?");
    var num = s.substring(p + "?order_num=".length), rest = s.substring(0, p);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a huge string that looks like this: Text Text Text Text Text
I have a method that looks like this: public static String escape(String text) {
I have a text string that has been doctored to be web safe URLs
I have a string of text that contains html, and I need to extract
I have a arbitrarily large string of text from the user that needs to
I have string: text and something and something like f213 @@ -1,9 +1,11 @@
We store a decimal(9,8) in our database. It can have any number of places
I have an ANSI-encoded CSV file that contains a number of 'problem' special characters.
I have a program that inputs text and sorts through it using a number
I have a text file that have strings enclosed within double-quotes. I want to

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.