# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/(?:^<\/?category-FOLDER|\G(?!^))\K\s*([\w:]+)(?!\S)/$1/gm;t' <<< "<category-FOLDER:test category name=\"Content Server Categories:FOLDER:test category\">
<attribute name=\"test attribuut\"><![CDATA[test]]></attribute>
<attribute name=\"test attribuut1\"><![CDATA[test1]]></attribute>
</category-FOLDER:test category>
<category-FOLDER1:FOLDER2:test category name=\"Content Server Categories:FOLDER1:FOLDER2:test category\">
<attribute name=\"test attribuut\"><![CDATA[test]]></attribute>
<attribute name=\"test attribuut1\"><![CDATA[test1]]></attribute>
</category-FOLDER1:FOLDER2:test category>
<category-FOLDER NAME:test category name=\"Content Server Categories:FOLDER NAME:test category\">
<attribute name=\"test attribuut\"><![CDATA[test]]></attribute>
<attribute name=\"test attribuut1\"><![CDATA[test1]]></attribute>
</category-FOLDER NAME:test category>
<category-FOLDER NAME: FOLDER NAME1:test category name=\"Content Server Categories:FOLDER NAME: FOLDER NAME1:test category\">
<attribute name=\"test attribuut\"><![CDATA[test]]></attribute>
<attribute name=\"test attribuut1\"><![CDATA[test1]]></attribute>
</category-FOLDER NAME: FOLDER NAME1:test category>
<category-FOLDER:test category name name=\"Content Server Categories:FOLDER:test category name\">
<attribute name=\"test attribuut\"><![CDATA[test]]></attribute>
<attribute name=\"test attribuut1\"><![CDATA[test1]]></attribute>
</category-FOLDER:test category name>"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html