Beberapa produk dan fitur sedang dalam proses penggantian nama. Fitur playbook dan alur generatif juga dimigrasikan ke satu konsol gabungan. Lihat detailnya.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Beberapa entitas perlu mencocokkan pola, bukan istilah tertentu.
Misalnya, nomor identitas nasional, tanda pengenal, pelat nomor, dan sebagainya.
Dengan entity ekspresi reguler,
Anda dapat memberikan
ekspresi reguler
untuk pencocokan.
Ekspresi reguler gabungan
Setiap entity regexp sesuai dengan satu pola,
tetapi Anda dapat memberikan beberapa ekspresi reguler
jika semuanya mewakili variasi dari satu pola.
Selama pelatihan agen, semua ekspresi reguler dari satu entitas digabungkan
dengan operator penggantian (|) untuk membentuk satu ekspresi reguler gabungan.
Misalnya, jika Anda memberikan ekspresi reguler berikut untuk nomor telepon:
Urutan ekspresi reguler sangat penting.
Setiap ekspresi reguler dalam ekspresi reguler gabungan diproses secara berurutan.
Penelusuran berhenti setelah kecocokan yang valid ditemukan.
Misalnya, untuk ekspresi pengguna akhir "Seattle":
Sea|Seattle cocok dengan "Laut"
Seattle|Sea cocok dengan "Seattle"
Penanganan khusus untuk pengenalan ucapan
Jika agen Anda menggunakan pengenalan ucapan
(dikenal juga sebagai input audio, speech-to-text, atau STT),
ekspresi reguler Anda akan memerlukan penanganan khusus saat mencocokkan huruf dan angka.
Ucapan lisan pengguna akhir pertama kali diproses oleh pengenal ucapan sebelum entity dicocokkan.
Jika ucapan berisi serangkaian huruf atau angka,
pengenal dapat mengisi setiap karakter dengan spasi.
Selain itu, pengenal dapat menafsirkan angka dalam bentuk kata.
Misalnya, ucapan pengguna akhir "ID saya adalah 123"
dapat dikenali sebagai salah satu dari hal berikut:
"ID saya adalah 123"
"ID saya adalah 1 2 3"
"My ID is one two three"
Untuk mengakomodasi angka tiga digit,
Anda dapat menggunakan ekspresi reguler berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eRegexp entities allow matching patterns rather than specific terms, useful for national IDs, license plates, and other structured data.\u003c/p\u003e\n"],["\u003cp\u003eMultiple regular expressions can be combined into a single compound regular expression using the alternation operator (\u003ccode\u003e|\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe order of regular expressions in a compound regular expression is important, as the system stops searching after the first valid match.\u003c/p\u003e\n"],["\u003cp\u003eSpecial handling is needed for regexp entities when using speech recognition, as the recognizer may add spaces or use word forms for digits.\u003c/p\u003e\n"],["\u003cp\u003eThere are limitations to using regexp entities, including the exclusion of fuzzy matching, a maximum of 50 regexp entities per agent, and a 2000-character limit for the compound regular expression.\u003c/p\u003e\n"]]],[],null,["# Regexp entities\n\nSome entities need to match patterns rather than specific terms.\nFor example, national identification numbers, IDs, license plates, and so on.\nWith *regexp entities* ,\nyou can provide\n[regular expressions](https://github.com/google/re2/wiki/Syntax)\nfor matching.\n\nCompound regular expressions\n----------------------------\n\nEach regexp entity corresponds to a single pattern,\nbut you can provide multiple regular expressions\nif they all represent variations of a single pattern.\nDuring agent training, all regular expressions of a single entity are combined\nwith the alternation operator (`|`) to form one *compound regular expression*.\n\nFor example, if you provide the following regular expressions for a phone number:\n\n- `^[2-9]\\d{2}-\\d{3}-\\d{4}$`\n- `^(1?(-?\\d{3})-?)?(\\d{3})(-?\\d{4})$`\n\nThe compound regular expression becomes:\n\n- `^[2-9]\\d{2}-\\d{3}-\\d{4}$|^(1?(-?\\d{3})-?)?(\\d{3})(-?\\d{4})$`\n\nThe ordering of regular expressions matters.\nEach of the regular expressions in the compound regular expression are processed in order.\nSearching stops once a valid match is found.\nFor example, for an end user expression of \"Seattle\":\n\n- `Sea|Seattle` matches \"Sea\"\n- `Seattle|Sea` matches \"Seattle\"\n\nSpecial handling for speech recognition\n---------------------------------------\n\n| **Note:** Enabling [auto speech adaptation](/dialogflow/cx/docs/concept/speech-adaptation) is recommended when using regexp entities. Also see the speech adaptation [regexp-specific guidelines](/dialogflow/cx/docs/concept/speech-adaptation#regexp-entities).\n\nIf your agent uses speech recognition\n(also known as audio input, speech-to-text, or STT),\nyour regular expressions will need special handling when matching letters and numbers.\nA spoken end-user utterance is first processed by the speech recognizer before entities are matched.\nWhen an utterance contains a series of letters or numbers,\nthe recognizer may pad each character with spaces.\nIn addition, the recognizer may interpret digits in word form.\nFor example, an end-user utterance of \"My ID is 123\"\nmay be recognized as any of the following:\n\n- \"My ID is 123\"\n- \"My ID is 1 2 3\"\n- \"My ID is one two three\"\n\nTo accommodate three digit numbers,\nyou could use the following regular expressions: \n\n```\n\\d{3}\n``` \n\n```\n\\d \\d \\d\n``` \n\n```\n(zero|one|two|three|four|five|six|seven|eight|nine) (zero|one|two|three|four|five|six|seven|eight|nine) (zero|one|two|three|four|five|six|seven|eight|nine)\n```\n\nCreate a regexp entity\n----------------------\n\n### Console\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your GCP project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. Click **Create**.\n7. Check **Regexp entities**.\n8. Complete remaining fields.\n9. Click **Save**.\n\n### API\n\nSet the `EntityType.kind` field to `KIND_REGEXP`.\n\n\nGo to the EntityType API reference \n**Select a protocol and version for the EntityType reference:**\n\nClose\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\nThe following limitations apply:\n\n- [Fuzzy matching](/dialogflow/cx/docs/concept/entity-fuzzy) cannot be enabled for regexp entities. These features are mutually exclusive.\n- Each agent can have a maximum of 50 regexp entities.\n- The [compound regular expression](#compound) for an entity has a maximum length of 2000 characters."]]