Why are regular expressions difficult?
To write regex with relative ease does require mastering some basic fundamentals of Regex.<p>For example to have a regex that can remove &#x2F;&#x2F; from inline comment of an INI-format text file.<p><pre><code>    (((\x27[ \!\&quot;\#\$\%\&amp;\(\)\*\+\-\.\&#x2F;0-9\:\;\&lt;\=\&gt;\?@A-Z\[\\\]\^\_\`a-z\|\~]*\x27\s*)|(\&quot;[ \!\#\$\%\&amp;\x27\(\)\*\+\-\.\&#x2F;0-9\:\;\&lt;\=\&gt;\?@A-Z\[\\\]\^\_\`a-z\|\~]*\&quot;\s*)|(\&#x2F;([ \!\$\%\&amp;\(\)\*\+\-\.0-9\:\&lt;\=\&gt;\?@A-Z\[\]\^\_\`a-z\|\~]+[ \!\$\%\&amp;\(\)\*\+\-\.0-9\:\&lt;\=\&gt;\?@A-Z\[\]\^\_\`a-z\|\~]*)|([ \!\$\%\&amp;\(\)\*\+\-\.0-9\:\&lt;\=\&gt;\?@A-Z\[\]\^\_\`a-z\|\~]*))*)*)([;#]+)*.*$
</code></pre>
That regex works very well and it’s breakdown can be better explained using various online Regex testers<p>Off-topically, I’ve got another next-level problem, and that is how to convert Regex for use within a bash shell script.<p>It’s nasty.<p>However, I have listed several online Regex testers so you can better understand the result of (my) Regex creation, one regex character at a time.<p><a href="https:&#x2F;&#x2F;www.debuggex.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.debuggex.com&#x2F;</a><p><a href="https:&#x2F;&#x2F;extendsclass.com&#x2F;regex&#x2F;4d49f33" rel="nofollow">https:&#x2F;&#x2F;extendsclass.com&#x2F;regex&#x2F;4d49f33</a><p><a href="https:&#x2F;&#x2F;www.freeformatter.com&#x2F;regex-tester.html" rel="nofollow">https:&#x2F;&#x2F;www.freeformatter.com&#x2F;regex-tester.html</a><p><a href="https:&#x2F;&#x2F;regexr.com&#x2F;6gv39" rel="nofollow">https:&#x2F;&#x2F;regexr.com&#x2F;6gv39</a><p>More online testers that I couldn’t get to work with are detailed in <a href="https:&#x2F;&#x2F;github.com&#x2F;egberts&#x2F;bash-ini-file&#x2F;issues&#x2F;1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;egberts&#x2F;bash-ini-file&#x2F;issues&#x2F;1</a>