\$ is not supported as a character
apostolou opened this issue · 3 comments
apostolou commented
Hello,
thank you for this library ! It would be nice to be able to escape dollar char in order to generate texts with dollars.
What do you think ?
thanks,
Michel
miner commented
You can use square brackets to quote the $. Something like this should work:
(gen/sample (sg/string-generator #"fo*bar[$]"))
;; => ("fbar$" "fobar$" "foobar$" "fobar$" "fobar$" "foooobar$" "foooobar$" "fooobar$" "fbar$" "fbar$")
I will consider supporting \$ and \^ notation as well but for now the current work-around is [$].
miner commented
Added support for \$ and \^ in new release: [com.velisco/strgen "0.1.7-alpha3"]. Please confirm that it works for you.
apostolou commented
Thank you very much ! I tested the fix and it works fine!