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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:38:28+00:00 2026-05-27T12:38:28+00:00

I have this regular expression: (?’box_id’\d{1,19}),box_name:(?’box_name'[\w\d\.\s]{1,19}) This works well, except when the box name

  • 0

I have this regular expression:

(?'box_id'\d{1,19})","box_name":"(?'box_name'[\w\d\.\s]{1,19})

This works well, except when the box name contains spaces. For example, when executing it on my box it returns mybox, without the space.

How can I make it include spaces in the box_name group?

Code:

Regex reg = new Regex(@"""object_id"":""(?<object_id>\d{1,19})"",""file_name"":""(?<file_name>[\w.]+(?:\s[\w.]+)*)""");
MatchCollection matches = reg.Matches(result);
if ( matches == null) throw new Exception("There was an error while parsing data."); 
if ( matches.Count > 0 )
{
  FileArchive.FilesDataTable filesdataTable = new FileArchive.FilesDataTable();
  foreach ( Match match in matches )
  {
    FileArchive.FilesRow row = filesdataTable.NewFilesRow();
    row.ID = match.Groups["object_id"].Value;
    row.Name = match.Groups["file_name"].Value;
  }
}

Input:

{“objects”:[{“object_id”:”135248″,”file_name”:”some space here.jpg”,”video_status”:”0″,”thumbnail_status”:”1″},{“object_id”:”135257″,”file_name”:”jup 13.jpg”,”video_status”:”0″,”thumbnail_status”:”1″},{“object_id”:”135260″,”file_name”:”my pic.jpg”,”video_status”:”0″,”thumbnail_status”:”1″},{“object_id”:”135262″,”file_name”:”EveningWav)es,Hon(olulu,Hawaii.jpg”,”video_status”:”0″,”thumbnail_status”:”1″},{“object_id”:”135280″,”file_name”:”test with spaces.jpg”,”video_status”:”0″,”thumbnail_status”:”1″}],”status”:”ok”}

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

    It appears to me that your data is consistently double quote delimited, no? That fact should be the basis of the regex:

    (?<box_id>\d{1,19})","file_name":"(?<box_name>[^"]{1,19})  //1 to 19 non " chars.
    

    As far as missing spaces, this token, (?’box_name'[\w\d.\s]{1,19}) , cannot match ‘mybox’ on a string containing ‘my box’, so that issue must be downstream.

    Typos and style: you have the literal ‘box_name’ but the tokens are ‘file_name’. Also, why in the world would you switch to using single quotes as the named group delimiter when <> brackets, the default, are MORE readable (since quotes are in the regex!)

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

Sidebar

Related Questions

Currently I have this regular expression to validate letters, dash and spaces. /^[a-zA-Z-\s]*$/ Now,
I have this regular expression in python: '<input type=hidden name=GALX value=(?P<galx>[a-zA-Z0-9_]+)>' I want an
I have this regular expression for URL ^(((https?|ftp|file|)://)|(www))[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]$ Almost all my test scenarios works
I have a this regular expression below for some input name fields. How do
I have this Regular Expression that matches the following strings: <!-- 09-02-2009 ---> <!--
Is a regular expression the correct way of going about this? I have a
I have this regular expression: regex = %r{\A(?<foo> a\g<foo>a | b\g<foo>b | c)\Z}x When
I have this regular expression: ([http://some.url.com/index.php?showtopic=\]*)([0-9]+(?:\.[0-9]*)?) its for extracting links to topics from forum
I have this regular expression to get urls: (((ht|f)tp(s?))://)?(www.|[a-zA-Z].)[a-zA-Z0-9-.]+.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(:[0-9]+) (/($|[a-zA-Z0-9.\,\;\?\'\+&%\$#\=~_-]+)) And I want to
I have this string: {example1}{example2}{example3} This is the regular expression to find these {

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.