Is there a nicer way to split a long regex over multiple lines?


I have this regex in a lazy_static! block:

    static ref IDENTIFIER: Regex = Regex::new(
        &(r"^[_\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lm}]".to_string() +

Is there a nicer way to have a regex split over two or more lines?


You need (?x) flag, see example at


Ah yes, thanks!