Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Regular-expressions/Argile/regular-expressions.argile
Normal file
22
Task/Regular-expressions/Argile/regular-expressions.argile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std, regex
|
||||
|
||||
(: matching :)
|
||||
if "some matchable string" =~ /^some" "+[a-z]*" "+string$/
|
||||
echo string matches
|
||||
else
|
||||
echo string "doesn't" match
|
||||
|
||||
(: replacing :)
|
||||
let t = strdup "some allocated string"
|
||||
t =~ s/a/"4"/g
|
||||
t =~ s/e/"3"/g
|
||||
t =~ s/i/"1"/g
|
||||
t =~ s/o/"0"/g
|
||||
t =~ s/s/$/g
|
||||
print t
|
||||
free t
|
||||
|
||||
(: flushing regex allocations :)
|
||||
uninit regex
|
||||
|
||||
check mem leak; use dbg (:optional:)
|
||||
Loading…
Add table
Add a link
Reference in a new issue