comment

Published on Tue Mar 01 2022

Additional matching regexes for
comment

INI Parser

Created for purpose of reading an INI file in C# applications. Supports comments and comment escape characters. I plan to add more escape characters (such as \=). s - Section scp - Section Comment Prefix sc - Section Comment k - Key v - Value kvcp - KeyValue Comment Prefix kvc - KeyValue Comment cp - Comment Prefix c - Comment I am open to any suggestion that may improve upon this regex, and/or would allow me to learn more. <br /> ##### Created by [Raxdiam](https://github.com/Raxdiam)

Match String ( /* 1 */)

Matches the comment string from Robo3T exports

more than 500 dollar detector

it's brute force and messy, share a comment to simply remove redundancy

Match multiline comments /* ... */

It won't match single line comments like this one: //* This comment won't be match */ ^ see the double / Works in PHP without the g modifier.

Strip multi-line (star) comments from JavaScript, while leaving any CDATA sections intact.

This regular expression removes multi-line (star) comments from JavaScript, while leaving any CDATA sections intact. Use the global (g) modifier to match them all (if you plan to use PHP's preg_replace, the g modifier is not necessary), and use the (s) modifier to make dots match newlines (this will be required in for using with PHP's preg_replace function). This regular expression does not exhaust all possibilities (such as a space between the opening or closing star comment and the CDATA tag), but it functions if the style guidelines are of the more popularized variety.