version.one.zero.one
版本发布时间: 2023-02-01 19:45:54
TodePond/DreamBerd最新发布版本:vaN.aN(2023-11-08 18:23:41)
Sup berdies, what's cookin? 🤙
Check out the latest DreamBerd release below 👇 And remember to smash that Star button and click Watch to get all the latest updates 🔔
Regular Expressions (thanks to @Pomierski)
You can now use the regular expression type to narrow string values.
const const email: RegExp<(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])> = "mymail@mail.com"!
To avoid confusion, you can use any spelling that you want, such as 'Regex' or 'RegularExpression'.
For reference, all supported regular expressions match the regular expression /Reg(ular)?[eE]xp?(ression)?/
.
Naming (thanks to @karolstawowski and @OsaidAlhomedy)
Variables and constants can now be named with any Unicode character or string.
const const firstAlphabetLetter = 'A'!
var const 👍 = True!
var var 1️⃣ = 1!
This includes numbers, and other language constructs.
const const 5 = 4!
print(2 + 2 === 5)! //true