> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/relate/segments/segments-whatsapp-groups.md).

# Segments - WhatsApp Groups

How to segment all WhatsApp groups in an instance.

## Initial instance settings

It is essential that, in 'System Settings > Account Settings > Whatsapp Web', groups can be registered on the platform as leads and their messages are not ignored. Note that the account connected to the platform must be a member of the group.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FjUt36aOaMEVAWYkLZFvM%2Fseg-0.png?alt=media&amp;token=eb29af7d-ed7a-4f2f-bcef-a4f79fa9457d" alt=""><figcaption><p><em>Instance Settings.</em></p></figcaption></figure>

## Creating the segment and adjusting the filter

After creating and naming the segment responsible for tagging the groups, in the 'Filters' tab, use the condition 'The lead field value...' to check whether the Whatsapp field meets the [regular expression](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Guide/Regular_expressions) '`(\D*\d){16,}`'.

In summary, this expression validates whether the lead's Whatsapp field contains 16 or more numeric characters. Since group IDs are longer than 16 characters, for example, '120363344586799553', these groups will be included automatically by the filter.&#x20;

After saving, the segment will be ready.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FbTIgIVdyjAxaZho8fXXP%2Fseg-2.png?alt=media&amp;token=d6ae23b6-2d32-4da3-9f55-382b6706be47" alt=""><figcaption><p><em>Configuring the filter.</em></p></figcaption></figure>
