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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -