An open API service indexing awesome lists of open source software.

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

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.