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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:22:41+00:00 2026-05-25T22:22:41+00:00

I am using the regexp, /(\<\s*?string(-array)?\s*?.*?\s*?\>\s*?)(.*)(\s*?\<\/string(-array)?\>)/ … to match all content between or tags

  • 0

I am using the regexp,

/(\<\s*?string(-array)?\s*?.*?\s*?\>\s*?)(.*)(\s*?\<\/string(-array)?\>)/ 

… to match all content between or tags of the form:

<string-array name="saveArray">
  <item>Téléphone</item>
  <item>Carte mémoires</item>
</string-array>

Problem is, I’m only able to match the contents of ‘string’ tags or arrays containing one item. When I replace the dot from the captured group in the middle with [^s], I get the content I want, but this solution would fail to match any content containing ‘s’. I tried a negative look-behind for ‘str’ immediately preceding the content (‘item-matching’) group, and it is giving me the same results.

Any help would be great!

  • 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-25T22:22:42+00:00Added an answer on May 25, 2026 at 10:22 pm

    You really should not parse xml using regexps.

    That said, I think the thing that’s messing you up might be that “.” (in many regexp engines, with default flags) matches any character except a newline.. So your .* will not match more than one line. Try replacing “.*” with “[\w\W]*“, or adding a regexp flag that says that “.” should match all characters.

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

Sidebar

Related Questions

Using regexp with tokens on cell array of strings I've got cell array of
im new with regexp, so can i ask for some assistance Using string.replace function
I'm using startswith reg exp in Javascript if ((words).match(^ + string)) but if I
I need to match a string holiding html using a regex to pull out
I'm trying to get all words inside a string using Boost::regex in C++. Here's
I'm confused about the array returned by a regex match when using both /g
How to split this string ? String s={hello.World::123}; to Stirng array: {hello,World,123} using regex
Im using the following regex to match the string below, so far so good.
I would like to return a array string[] or a list List<string> using regex
I trying out using regEx to split a String which gives me an array

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.