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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:24:43+00:00 2026-06-08T08:24:43+00:00

I am trying to limit the contents of an xml element using a regex

  • 0

I am trying to limit the contents of an xml element using a regex pattern within the schema but I just cant get it working and the more I add the worse it seems to get.

The requirements are as follows:

  • The element string can’t be longer that 512 characters (This bit’s easy but added for completeness)
  • The string consists of multiple key value pairs.
  • The key value pairs will be separated by ‘^’
  • Each key value pair consists of a 3 character key, followed any number of characters for the value.
  • The keys will be separated from the values by ‘|’

An example of the XML would be:

<myElement>
    ABC|This is some value text for key ABC^DEF|This is some value text for key DEF^GHI|This is some value text for key GHI^JKL|This is some value text for key JKL^
</myElement>
  • 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-06-08T08:24:44+00:00Added an answer on June 8, 2026 at 8:24 am

    In the question you say “The key/value pairs will be separated by ‘^'”, but the example shows the key/value pairs terminated by ‘^’, so I’m assuming that’s what you want.

    The key matches \w{3} (3 letters or digits).

    The value matches [^^<]* (any number of any characters except ^).

    The complete regex is (\w{3}\|[^^]*\^)*.

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

Sidebar

Related Questions

I'm trying to limit the number of connections my server will accept using semaphores,
I'm trying to limit the number of records from an XML feed that are
I'm trying the moving limit after zoom with canvas scale, but new coordinates does
I'm trying to add a character limit clause to this white list regex approach
Working with an API that spits out the contents in p tags ... but
I'm trying to get my backbone associations working inside a rails app , and
I'm trying to get full text search working in Yii and I can't seem
I'm trying to parse a moderately large XML file (6mb) in php using simpleXML.
I am trying to limit what content the subscribers can see but nothing I
I am trying to limit the swipe area of the UIScrollview, but i amnot

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.