Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 26, 2024
1 parent 66cc802 commit 85814d0
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/frontend/src/handler/create_sql_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,6 @@ fn create_mock_udf_context(
ret
}

/// Find the pattern for better hint display
/// return the exact index where the pattern first appears
fn find_target(input: &str, target: &str) -> Option<usize> {
// Regex pattern to find `target` not preceded or followed by an ASCII letter
// The pattern uses negative lookbehind (?<!...) and lookahead (?!...) to ensure
// the target is not surrounded by ASCII alphabetic characters
let pattern = format!(r"(?<![A-Za-z]){0}(?![A-Za-z])", fancy_regex::escape(target));
let Ok(re) = Regex::new(&pattern) else {
return None;
};

let Ok(Some(ma)) = re.find(input) else {
return None;
};

Some(ma.start())
}

pub async fn handle_create_sql_function(
handler_args: HandlerArgs,
or_replace: bool,
Expand Down

0 comments on commit 85814d0

Please sign in to comment.