---
url: /reference/packages/regex/src/namespaces/CssDocGrammarPatterns/variables/CSSDOC_IDENTIFIER.md
---
# Variable: CSSDOC_IDENTIFIER

```ts
const CSSDOC_IDENTIFIER: Regex<"(?<identifier>[A-Za-z_][\\w-]*)", {
  names: {
     identifier: string;
  };
}>;
```

Defined in: [packages/regex/src/tiers/css-doc-grammar.ts:28](https://github.com/thedannywahl/cssdoc/blob/main/packages/regex/src/tiers/css-doc-grammar.ts#L28)

CssDoc Identifier from grammar.
Starts with ASCII letter or underscore; followed by word chars (ASCII) or hyphens.
Grammar rule: Identifier :: IdentifierStart IdentifierPart\*

## Example

```ts
CSSDOC_IDENTIFIER.exec("button")?.groups?.identifier // "button"
CSSDOC_IDENTIFIER.exec("my-component")?.groups?.identifier // "my-component"
CSSDOC_IDENTIFIER.exec("_private")?.groups?.identifier // "_private"
```
