Skip to main content

new_pattern

Function new_pattern 

Source
pub fn new_pattern(prefix: Option<&str>, suffix: Option<&str>) -> String
Expand description

Create new pattern string based on prefix and suffix。

The rule is similar to event.NewPattern in the Go version:

  • If a prefix is provided and does not end with ‘’, ‘’ is appended.
  • If a suffix is provided and does not start with ‘’, then prefix ‘’.
  • Replace “**” with “*”.