> For the complete documentation index, see [llms.txt](https://regex-simplify.lacostar.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://regex-simplify.lacostar.fr/docs/global/hex.md).

# hex

{% tabs %}
{% tab title="Function types" %}

<pre class="language-typescript"><code class="lang-typescript"><strong>hex(color: string): { 
</strong>    include: boolean, 
    matchs: RegExpMatchArray | null, 
    groups: Array&#x3C;{ 
        color: string | undefined
    } | null> | null
}
</code></pre>

{% endtab %}

{% tab title="Code example" %}
**Search hex color in a string:**

<pre class="language-javascript"><code class="lang-javascript"><strong>const { global } = require('regex-simplify');
</strong>
const color = global.hex(`
    #F56
    0xF56
`)

console.log(color);
</code></pre>

{% endtab %}

{% tab title="Function return" %}
**And here what return the function:**

```javascript
{
  include: true,
  matchs: [ '#F56', '0xF56' ],
  groups: [
    [Object: null prototype] { color: 'F56' },
    [Object: null prototype] { color: 'F56' }
  ]
}
```

{% endtab %}
{% endtabs %}
