Renamed ./examples/external to ./examples/extensions. No code changes. (0.40.6)
This commit is contained in:
parent
28545fa8d4
commit
c68244d6f6
32 changed files with 40 additions and 41 deletions
32
examples/extensions/pcre2/pcre2_showcase.fun
Executable file
32
examples/extensions/pcre2/pcre2_showcase.fun
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2025 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2025-11-25
|
||||
*/
|
||||
|
||||
/*
|
||||
include <regex/pcre2.fun>
|
||||
|
||||
re = PCRE2()
|
||||
|
||||
print("Testing PCRE2 showcase...")
|
||||
|
||||
print(re.test("\\d+", "Order #1234"))
|
||||
|
||||
m = re.match("(\\w+)", "hello WORLD", re.i())
|
||||
if m != nil {
|
||||
print(m["full"]) // hello
|
||||
print(len(m["groups"]))
|
||||
}
|
||||
|
||||
for x in re.find_all("[a-z]+", "One two THREE four", re.i()) {
|
||||
print(x["full"]) // one two four
|
||||
}
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue