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

  • Home
  • SEARCH
  • 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 7443357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:05+00:00 2026-05-29T11:19:05+00:00

I have a string and I need to parse it for a value… var

  • 0

I have a string and I need to parse it for a value…

var msg = "Sometext can't do this. Blah blah blah Version id: 'xxx'";

How can I use regex and get the text between the last two single quotes? xxx
Notice the first single quote in {can’t}
The value I’m seeking will always be between the last set on single quotes.
A brief explanation of the regex would be awesome as well.

Thanks so much for any help, tips, examples.

  • 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-29T11:19:05+00:00Added an answer on May 29, 2026 at 11:19 am

    This is the final Regex

        (?<=')[^']*(?='$)
    

    The general pattern I use is

        (?<=prefix)find(?=suffix)
    

    It finds a pattern that lies between a prefix and a suffix. What we want to find is

        [^']*
    

    This means anything but the single quote (') repeated zero or more times.

    Finally we look for '$ at the end, not just '. This means that the single quote must be at the end of the line.

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

Sidebar

Related Questions

I have a string like this that I need to parse into a 2D
i have a string that looks like this: /dir/location/test-load-ABCD.p and i need to parse
I have a large string I need to parse, and I need to find
I have some sort of recursive function, but I need to parse a string,
I need to parse XML string into an array. I have XML <group xmlns=123
I have a list of integers which I need to parse into a string
I have class Errors. I have value errorCode. I need get string by errorCode.
I'm running into this situation where I need to parse a String into an
I have a need to parse Bezier Path Strings, but apparently the System.Windows.Media.Geometry version
I have a string I need to parse. It meets the following requirements: It

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.