Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Regular-expressions/Ol/regular-expressions.ol
Normal file
11
Task/Regular-expressions/Ol/regular-expressions.ol
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
; matching:
|
||||
(define regex (string->regex "m/aa(bb|cc)dd/"))
|
||||
(print (regex "aabbddx")) ; => true
|
||||
(print (regex "aaccddx")) ; => true
|
||||
(print (regex "aabcddx")) ; => false
|
||||
|
||||
; substitute part of a string:
|
||||
(define regex (string->regex "s/aa(bb|cc)dd/HAHAHA/"))
|
||||
(print (regex "aabbddx")) ; => HAHAHAx
|
||||
(print (regex "aaccddx")) ; => HAHAHAx
|
||||
(print (regex "aabcddx")) ; => false
|
||||
Loading…
Add table
Add a link
Reference in a new issue