message: subscriber: support special chars in span names
  Filtering log events using the `target[span{field=value}]=level` syntax
  doesn't work when the span name contains a special char.
  This PR closes by adding support for span names with any
  characters other than `{` and `]` to `EnvFilter`.
diff: @@ -195,7 +195,7 @@ impl FromStr for Directive {
  )
  .unwrap();
  static ref SPAN_PART_RE: Regex =
  - Regex::new(r#"(?P<name>\w+)?(?:\{(?P<fields>[^\}]*)\})?"#).unwrap();
  + Regex::new(r#"(?P<name>[^\]\{]+)?(?:\{(?P<fields>[^\}]*)\})?"#).unwrap();
  static ref FIELD_FILTER_RE: Regex =
  // TODO(eliza): this doesn't _currently_ handle value matchers that include comma
  // characters. We should fix that.
  @@ -1091,4 +1091,34 @@ mod test {
  assert_eq!(dirs[0].level, LevelFilter::INFO);
  assert_eq!(dirs[0].in_span, None);
  }
  +
  + #[test]
  + fn parse_directives_with_dash_in_span_name() {
  + // Reproduces https://github.com/tokio-rs/tracing/issues/1367
  +
  + let dirs = parse_directives("target[span-name]=info");
  + assert_eq!(dirs.len(), 1, "\nparsed: {:#?}", dirs);
  + assert_eq!(dirs[0].target, Some("target".to_string()));
  + assert_eq!(dirs[0].level, LevelFilter::INFO);
  + assert_eq!(dirs[0].in_span, Some("span-name".to_string()));
  + }
  +
  + #[test]
  + fn parse_directives_with_special_characters_in_span_name() {
  + let span_name = "!\"#$%&'()*+-./:;<=>?@^_`|~[}";
  +
  + let dirs = parse_directives(format!("target[{}]=info", span_name));
  + assert_eq!(dirs.len(), 1, "\nparsed: {:#?}", dirs);
  + assert_eq!(dirs[0].target, Some("target".to_string()));
  + assert_eq!(dirs[0].level, LevelFilter::INFO);
  + assert_eq!(dirs[0].in_span, Some(span_name.to_string()));
  + }
  +
  + #[test]
  + fn parse_directives_with_invalid_span_chars() {
  + let invalid_span_name = "]{";
  +
  + let dirs = parse_directives(format!("target[{}]=info", invalid_span_name));
  + assert_eq!(dirs.len(), 0, "\nparsed: {:#?}", dirs);
  + }
  }
  