Paulo Cereda
01/09/2025, 9:42 AMval words = Regex("""\w+""")
val digits = Regex("""\d+""")
combined into \w+|\d+
via words | digits
or similar. Any suggestions are welcome. Thanks! 🙂Vampire
01/09/2025, 9:51 AMVampire
01/09/2025, 9:52 AM\w
already includes \d
Vampire
01/09/2025, 9:53 AM\w+|\d+
is identical to \w+
ephemient
01/09/2025, 10:03 AMval words = """\w+""".toRegex()
ephemient
01/09/2025, 10:05 AMval both = "${words.pattern}|${digits.pattern)".toRegex()
but that will break back-references within each pattern, and doesn't handle differing regex options eitherephemient
01/09/2025, 10:08 AMval re1 = """([a-z]+)""".toRegex(RegexOption.IGNORE_CASE)
val re2 = """(['"]).*\1""".toRegex(RegexOption.DOT_MATCHES_ALL)
Michael de Kaste
01/09/2025, 10:13 AMbuildRegex{
either{
capture("""\w+""", name = "words")
capture("""\d+""", name = "numbers")
just("""\s+""")
}
}
you could maybe make that?Vampire
01/09/2025, 10:16 AMephemient
01/09/2025, 10:23 AMPaulo Cereda
01/09/2025, 5:47 PMephemient
01/09/2025, 9:11 PMPaulo Cereda
01/10/2025, 11:15 AM