Note that there are some explanatory texts on larger screens.

plurals
  1. POParameterizing using Regex
    primarykey
    data
    text
    <p>I am trying to implement a c++ parser using boost and regex. I need to be able to parse statements like the following:</p> <pre><code>parameters a1=bbb b a2=bbb b a3 =bbb parameters a4=b a5=bb parameters a6=b a7=[b b b] aa8=b b b </code></pre> <p>For this input, the desired parameters would be:</p> <pre><code>a1=bbb b a2=bbb b a3 =bbb a4=b a5=bb a6=b a7=[b b b] aa8=b b b </code></pre> <p>Where a and b could be any of the following chars: A-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%_\,;:|/&amp;()-+*^.&lt;> or the following patterns: (==)(&lt;=)(>=) The name of the parameter does not allow spaces, however, the value does.</p> <p>I was trying the code below, but it does not work properly:</p> <pre><code>[A-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+\s*=\s*([\sA-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+(?!(([\sA-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+)?\s*=\s*[\sA-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+))|[A-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+|(\[[\sA-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+\])) </code></pre> <p>The pattern</p> <pre><code>[A-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+\s*=\s*([A-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+|(\[[\sA-Za-z0-9çÇñÑáÁéÉíÍóÓúÚ@%\_\\\,\;\:\|\/\&amp;\(\)\-\+\*\^\.(==)\&gt;\&lt;(\&lt;=)(\&gt;=)]+\])) </code></pre> <p>works as far as the value does not contain spaces. Could you please help me?</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload