VOCABULARY
Regular expression (regex)
A regular expression (regex) is a sequence of characters that defines a search pattern, often used for pattern matching within strings. Itâs commonly used in text processing to find, replace, or validate strings based on certain patterns.
Examples:
- Basic Pattern Matching:some text
- Regex: cat
- Matches: âThe cat is on the mat.â (finds the word âcatâ in the text)
- Wildcard Character (.):some text
- Regex: c.t
- Matches: âThe catâ, âcutâ, or âcotâ (any character between âcâ and âtâ).
- Digit Matching (\d):some text
- Regex: \d{3}
- Matches: âThere are 123 apples.â (matches any sequence of three digits)
Regular expressions allow you to create flexible patterns to handle diverse text search and validation needs. Learn more.
Learn how to protect against the most common LLM vulnerabilities
Download this guide to delve into the most common LLM security risks and ways to mitigate them.
Related terms
Activate
untouchable mode.
untouchable mode.
Get started for free.
Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.
Join our Slack Community.
Several people are typing about AI/ML security. â¨Come join us and 1000+ others in a chat thatâs thoroughly SFW.