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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:58:22+00:00 2026-05-30T14:58:22+00:00

I have been spending too much time trying to extract this. I have the

  • 0

I have been spending too much time trying to extract this. I have the following message and I want to extract the data part of the message “data {{….. }}” before the arguments. I cannot rely on the order of the messages so arguments result and command could be seen in any order in the message.

invokeid 3  data {{GainID|Value(dB)}  {0|0} {1|18} {2|17} {3|-1} {4|-255} {5|0} {6|12} {7|11} {8|10} {9|9} {10|8} {11|7} {12|6} {13|5} {14|4} {15|3} {16|2} {17|1} {18|0} {19|-1} {20|-2} {21|-3} {22|-4} {23|-5} {24|-6} {25|-7} {26|-8} {27|-9} {28|-10} {29|-11} {30|-12} {31|-13} {32|-14} {33|-15} {34|-16} {35|-17} {36|-18} {37|-19} {38|-20} {39|-21} {40|-22} {41|-23} {42|-24} {43|-25} {44|-26} {45|-27} {46|-28} {47|0}} arguments {{ DisplayGain -1 }} result 0 command OAMPCMD IPaddress 0.0.0.0

This is want I want to parse

data {{GainID|Value(dB)}  {0|0} {1|18} {2|17} {3|-1} {4|-255} {5|0} {6|12} {7|11} {8|10} {9|9} {10|8} {11|7} {12|6} {13|5} {14|4} {15|3} {16|2} {17|1} {18|0} {19|-1} {20|-2} {21|-3} {22|-4} {23|-5} {24|-6} {25|-7} {26|-8} {27|-9} {28|-10} {29|-11} {30|-12} {31|-13} {32|-14} {33|-15} {34|-16} {35|-17} {36|-18} {37|-19} {38|-20} {39|-21} {40|-22} {41|-23} {42|-24} {43|-25} {44|-26} {45|-27} {46|-28} {47|0}} 

And it is done with the following code:

        string ret = String.Empty;
        Regex regEx = new Regex("data {{.*}}");
        Match regExMatch = regEx.Match(iqMessage);
        if (!regExMatch.Success)
            throw new IqScriptControlMessageParseException(String.Format("Could not find {0}.", DATA));

        ret = regExMatch.Value.Substring(DATA.Length).Trim();

I was not able to successfully build a regex that works your help would be appreciated. I am about to code the extraction manually if you know what I mean…

Thanks

  • 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-30T14:58:23+00:00Added an answer on May 30, 2026 at 2:58 pm

    Use a non-greedy match (.*? instead of .*), and escape the curlies (they have special meaning in regular expressions):

    Regex regEx = new Regex(@"data \{\{.*?\}\}");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been spending some time on this. My problem involves bringing back domain
Recently, I have been spending a lot of my time researching the topic of
I have been trying to get a response from a server sending a GET
I have been trying to create a Main program that calls another program, sending
Have been working on this question for a couple hours and have come close
First time poster so sorry if this is too long, but I've hit a
I have been trying to send a big attachment (9 MB) using C# ASP.NET
I'm writing an android application in OpenCV, and have been spending a few hours
I have been trying to load a html file in a webview in a
I've been spending time to assimilate the methodologies behind writing testable code, and I

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.