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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:10:02+00:00 2026-05-30T08:10:02+00:00

Getting my feet wet in Regular Expressions, and I’m having a difficult time getting

  • 0

Getting my feet wet in Regular Expressions, and I’m having a difficult time getting this one to work.

I have a url as such:

/800-Flowers-inc-4124/18-roses-3123

Where 4124 is the business ID, and 3123 is the product ID.

The hard part for me is creating the capturing groups. Currently, my regex is as follows:

/(\d+)(?=/|$)/g

Unfortunately, that only selects the business ID, and doesn’t return the product ID.

Any help is greatly appreciated, and if you provide a regex, I would love if you could put a little explanation

thanks!

  • 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-30T08:10:04+00:00Added an answer on May 30, 2026 at 8:10 am

    Your regex is fine, except since you’ve used the / as the regex delimiter you need to escape it in the expression:

    /(\d+)(?=\/|$)/g
    

    Or, you can just use a different delimiter (e.g. @):

    @(\d+)(?=/|$)@g
    

    Depending on the language you’re using it’ll probably return the results in some sort of array, or there could be a ‘findAll’-type method instead of just ‘find’.

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

Sidebar

Related Questions

I'm getting my feet wet with DI/IoC and MEF in particular. I have a
I'm getting my feet wet in DBIx::Class — loving it so far. One problem
I'm just getting my feet wet with Android and have built a UI that
I have recently been getting my feet wet in MongoDB using Mongoid w/ Rails
Trying to get my feet wet with PySide development but having trouble getting setup.
just getting my feet wet with sql server express. I have what would be
I am getting my feet wet with Git and have the following issue: My
I am getting my feet wet with git, and wondered if this was an
I'm getting my feet wet in OOP and have a question about __construct() content:
I am fairly new with Objective C and getting my feet wet! I have

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.