some kool regex things

2025-06-21

I rarely use regex (regular expressions) beyond basics such as these:

I recently had to do more fancy things:

For an example of how the above 2 work, consider this text:

asm!(
    "jmp {}",
    label {},
);

The following regex will match asm!, followed by label, followed by {, while ignoring all that is between those:

asm!(?s:.)+label(?m:\s)*\{

The regex dialect used is that of the Rust regex crate.