# Regular expression — prompt for Gemma

Build an expression from positive and negative examples, following the selected language's syntax.

Canonical URL: https://boswidget.ru/en/regular-expression-prompt-for-gemma/

Model: Gemma

Category: Code

Tags: regex, strings, validation

![Regular expression](https://boswidget.ru/assets/images/text-preview-gemma-regex-pattern-1200.8dedebad3699.webp)

Regular expression

## Prompt

Propose a regular expression for {engine}. Must match: {positive}. Must not match: {negative}. Rules: {rules}. First clarify whether to validate the entire string or find a substring; if unspecified, show both versions. Explain groups and anchors, and give expected-match tables for the examples and five boundary cases. Do not claim to have executed the expression. If examples contradict the rules, identify the conflict before suggesting a solution.

## Template fields

- `{engine}` — Language or engine. Example input: For example: JavaScript RegExp
- `{positive}` — Positive examples. Example input: Strings that should match, one per line
- `{negative}` — Negative examples. Example input: Strings that must not match
- `{rules}` — Rules. Example input: Permitted characters, length, case and search mode

## Launch

[Open Gemma in YesAI](https://yesai.su/en/gemma)
