Convert a regex struct in to a string in elixir -
is there simple way string representation of regex? passing regex io.inspect
prints out string representation assume must possible in way
you can use regex.source/1
.
regex.source(regex)
returns regex source binary.
demo:
iex(1)> regex.source(~r/[a-z]/) "[a-z]"
Comments
Post a Comment