https://github.com/theholyonez/regex-pattern
Regex Patterns for: html,css,js,xml blah blah blah
https://github.com/theholyonez/regex-pattern
Last synced: 3 months ago
JSON representation
Regex Patterns for: html,css,js,xml blah blah blah
- Host: GitHub
- URL: https://github.com/theholyonez/regex-pattern
- Owner: TheHolyOneZ
- Created: 2025-05-27T00:26:14.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-05-27T00:30:42.000Z (4 months ago)
- Last Synced: 2025-05-27T01:31:06.939Z (4 months ago)
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> For one line "//" comments
```regex
^\s*//.*$
```
> For inline "//" comments
```regex
(? For one line `` comments
```regex
^\s*` comments
```regex```
> for One line "/* */" comments
```regex
^\s*/\*.*?\*/\s*$
```
or
```regex
^\s*/\*.*\*/\s*$
```> for inline "/* */" comments
```regex
/\*.*?\*/
```---
## Enhanced & Additional Regex Patterns
> For multi-line block comments (JS/C/Java)
```regex
/\*[\s\S]*?\*/
```> For all single-line and block comments (JS/TS, one pass)
```regex
(//.*$)|(/\*[\s\S]*?\*/)
```> For TODO or FIXME comments (anywhere)
```regex
//.*\b(TODO|FIXME)\b.*
```> For Python one-line comments
```regex
^\s*#.*$
```> For Python inline comments
```regex
(? For HTML multi-line comments
```regex```
> For removing empty lines (cleanup)
```regex
^\s*$
```> For trailing whitespace (cleanup)
```regex
[ \t]+$
```---
**Tips:**
- Always test regex on a copy of your code!
- For multi-line patterns, enable the "dotall" or "s" flag if your tool supports it.
- Some patterns may need tweaking for your editor or language.