Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -1,5 +1,4 @@
|
|||
julia> ismatch(r"^\s*(?:#|$)", "not a comment")
|
||||
false
|
||||
|
||||
julia> ismatch(r"^\s*(?:#|$)", "# a comment")
|
||||
true
|
||||
s = "I am a string"
|
||||
if ismatch(r"string$", s)
|
||||
println("'$s' ends with 'string'")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,41 +1,2 @@
|
|||
julia> m = match(r"(a|b)(c)?(d)", "acd")
|
||||
RegexMatch("acd", 1="a", 2="c", 3="d")
|
||||
|
||||
julia> m.match
|
||||
"acd"
|
||||
|
||||
julia> m.captures
|
||||
3-element Union(UTF8String,ASCIIString,Nothing) Array:
|
||||
"a"
|
||||
"c"
|
||||
"d"
|
||||
|
||||
julia> m.offset
|
||||
1
|
||||
|
||||
julia> m.offsets
|
||||
3-element Int64 Array:
|
||||
1
|
||||
2
|
||||
3
|
||||
|
||||
julia> m = match(r"(a|b)(c)?(d)", "ad")
|
||||
RegexMatch("ad", 1="a", 2=nothing, 3="d")
|
||||
|
||||
julia> m.match
|
||||
"ad"
|
||||
|
||||
julia> m.captures
|
||||
3-element Union(UTF8String,ASCIIString,Nothing) Array:
|
||||
"a"
|
||||
nothing
|
||||
"d"
|
||||
|
||||
julia> m.offset
|
||||
1
|
||||
|
||||
julia> m.offsets
|
||||
3-element Int64 Array:
|
||||
1
|
||||
0
|
||||
2
|
||||
s = "I am a string"
|
||||
s = replace(s, r" (a|an) ", " another ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue