September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
10
Task/Regular-expressions/Phix/regular-expressions.phix
Normal file
10
Task/Regular-expressions/Phix/regular-expressions.phix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
include builtins\regex.e
|
||||
string s = "I am a string"
|
||||
printf(1,"\"%s\" %s with string\n",{s,iff(length(regex(`string$`,s))?"ends":"does not end")})
|
||||
printf(1,"\"%s\" %s with You\n",{s,iff(length(regex(`^You`,s))?"starts":"does not start")})
|
||||
?gsub(`[A-Z]`,"abCDefG","*")
|
||||
?gsub(`[A-Z]`,"abCDefGH","(&)")
|
||||
?gsub(`[A-Z]+`,"abCDefGH","(&)")
|
||||
?gsub(`string`,s,"replacement")
|
||||
s = gsub(`\ba\b`,s,"another") ?s
|
||||
?gsub(`string`,s,"replacement")
|
||||
Loading…
Add table
Add a link
Reference in a new issue