pub fn parse_variable_name(input: Span<'_>) -> IResult<Span<'_>, Span<'_>>Expand description
Variable names must start with an alphabetic character, then any number of alphanumeric characters, hyphens and underscores.
ยงExamples
Variables can consist of letters and underscores.
use blogs_md_easy::{parse_variable_name, Span};
let input = Span::new("publish_date");
let (_, variable) = parse_variable_name(input).unwrap();
assert_eq!(variable.fragment(), &"publish_date");Variables cannot start with a number or underscore.
use blogs_md_easy::{parse_variable_name, Span};
let input = Span::new("1_to_2");
let variable = parse_variable_name(input);
assert!(variable.is_err());