What is Nostr?
Bolognium /
npub1jy4…p556
2023-10-10 20:51:39
in reply to nevent1q…gnmk

Bolognium on Nostr: npub18yve5…jxxyn Oh, interesting. That's very different from Perl/JavaScript then, ...

npub18yve5f33hyqq35t3y3xu72t9x33pfdznd0kq78lf73wkxchzr5hsmjxxyn (npub18yv…xxyn) Oh, interesting. That's very different from Perl/JavaScript then, which uses /s (confusingly referred to as "single line" mode sometimes) to make . match newlines.

The main point, however, is that /x ignores whitespace in the regex, not in the string it is matching against. That is, instead of /(?<test1>.*stage\(.Test.\)\s+\{[^}]+\})/, you can write /(?<test1> .* stage\( . Test . \) \s+ \{ [^}]+ \} )/x or even:

/ (?<test1>
.*
stage\( . Test . \)
\s+
\{ [^}]+ \} # a block in curly braces
)
/x


And it all does the same thing since /x mode effectively strips whitespace/comments from the regex before matching.
Author Public Key
npub1jy4jrkyr66uzu6hqze36u2x8rq4g45hv6977dgc4kgkqpguq07fqwxp556