`-` is not a legal character in variable name

This commit is contained in:
cyqsimon 2023-11-05 22:30:47 +08:00
parent 1f10d846a3
commit 12fa2cb1eb
No known key found for this signature in database
GPG Key ID: 1D8CE2F297390D65
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ impl FromStr for Matcher {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use MatcherSegment as Seg;
static VAR_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\$\{([\w\d_\-]+)\}").unwrap());
static VAR_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\$\{([\w\d_]+)\}").unwrap());
let mut segments = vec![];
let mut text_start = 0;