Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e71a714

Browse files
committed
Fix regex match?.
1 parent a292b28 commit e71a714

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std_lib/regex.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ defmodule ElixirScript.Regex do
2020
end
2121

2222
def match?(regex, string) do
23-
regex.test(string)
23+
reg = if regex?(regex), do: regex, else: compile!(source(regex), opts(regex))
24+
reg.test(string)
2425
end
2526

2627
def source(regex) do

0 commit comments

Comments
 (0)