A reminder that a regex ending in "$" probably doesn't do what you want it to do (unless you are using #rakulang!)

(I.E. /^[0-9]$/ will match both "0" and "0\n")

You probably want \z (edit). \n will generally match either the end of the string or a newline right before the end of the string. So if you don't want newlines in your database...

This is true in #perl and #python. However, #rakulang redefines default $ matching behavior, so it does not match a trailing newline by default.

Follow

@joelle In JS, this also seems to work as expected, only matching a newline when specifying multiline mode.

· · Web · 0 · 1 · 1
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.