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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:27:43+00:00 2026-05-12T19:27:43+00:00

Given the following string: ‘s0\\8\\26\\29\\30\\32’ or ‘s0\\8\\26\\’ or ‘s0\\5’, I need to return the

  • 0

Given the following string: ‘s0\\8\\26\\29\\30\\32’ or ‘s0\\8\\26\\’ or ‘s0\\5’, I need to return the last digits of the string.

Given:

 function getFolderID(mystr) {
        var reFolderID = /\bs0\\\\[0-9]+\b/g //regexp to return s0\\34
        var retArr = [];
        var retval = '';

        retArr = mystr.match(reFolderID);
        retArr = retArr[0].replace(/s0\\\\/g, "");

        if (retArr != null) {
            retval = retArr[retArr.length - 1];
        }
        //alert("Ret: " + retval);
        return retval;
    }  

At first I thought I just needed the first digits, but turns out I need the last ones.

What would the proper regexp term be for this?

Also, how can I create an ASP.Net event handler to do something with the returned JS value?

  • 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-12T19:27:43+00:00Added an answer on May 12, 2026 at 7:27 pm

    You might try the following. It should following the formatting and group the last set of numbers.

    /s0\\\\(?:[0-9]+\\\\)*([0-9]+)/
    

    So, something like:

    function getFolderID(mystr) {
        // search string for last group of digits in the pattern
        var matches = mystr.match(/s0\\\\(?:[0-9]+\\\\)*([0-9]+)/);
    
        // if matches is null, replace with "defaults"
        matches ||= ["", ""];
    
        // grab the first grouped match
        return matches[1];
    }
    

    As for the ASP.NET event, you’ll probably have to use Ajax — such as by <asp:UpdatePanel /> or your choice of Ajax library (jQuery, Prototype, etc.).

    Without Ajax, JavaScript and ASP.NET will never execute at the same time.

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

Sidebar

Related Questions

Given the following string I need to find the last occurance of the string
Given the following string variable VAR=foo bar I need it to be passed to
Given the following directory: string fullpath = C:\MyDir1\MyDir2\MyDir3; I would like to return MyDir3
Given the following: StreamLogger& operator<<(const char* s) { elements.push_back(String(s)); return *this; } StreamLogger& operator<<(int
Given the following string: var str = one,two,three; If I split the string on
Given the following code: string istanbul = 523; Convert.ToInt32(istanbul.ToString(00)); what does it return?
given the following code: string[] colors = {red,green,blue,red,green,blue}; var distinctColors = (from c in
What is need is given the following string Other Text [[MyText]] Some Other Text
Given the following function: create or replace FUNCTION GETADDRESSES RETURN sys_refcursor IS address_cursor sys_refcursor;
Given the following code: case class ChangeSet(field:String, from:Object, to:Object) private var changed:List[ChangeSet] = Nil

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.