Const
Provides regex pattern suggestions based on keywords found in the input text.
The user-provided text to analyze for suggestions.
An array of string suggestions, limited to the top 5 most relevant.
Input text to analyze for pattern suggestion opportunities. Accepts typos, partial words, unclear descriptions, or exploratory queries. The function intelligently matches against known pattern keywords and provides guidance.
Curated array of suggestion strings (maximum 5) including:
// Typo correction
const corrections = textToSuggestions("emial addres");
// Returns suggestions to use "email address"
// Pattern discovery
const discovery = textToSuggestions("number");
// Returns various number patterns: phone, credit card, zip code, etc.
// Blank slate guidance
const help = textToSuggestions("");
// Returns: ["Available patterns: email, phone, url...", "Use descriptive keywords..."]
Generates contextual pattern suggestions from text analysis. This intelligent alias for
getPatternSuggestions
analyzes input text and provides smart recommendations for pattern creation, helping users discover available patterns and improve their natural language descriptions.