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.