Fork me on GitHub

I'm trying (unsuccessfully) to use a regex with the re-com input-text component. I've taken the regex expression from the re-com demo page for the input-text component but can't seem to get it to work. When I try and type anything into the textbox, nothing appears. If I remove the :validation-regex key and type into the textbox, the characters appear as expected. What am I doing wrong? The code

(defn main-component []

  (let [data (reagent/atom "")
        regex (reagent/atom #"^(\\d{0,2})$|^(\\d{0,2}\\.\\d{0,1})$")]
       :size "auto"
       :gap "10px"
        [box :width "150px" :child [label :label "Enter data..."]]
        [box :child [input-text
                     :width "300px"
                     :model data
                     :on-change #(reset! data %)
                     :validation-regex @regex
                     :change-on-blur? false]]


Is there a free for commercial use db that is commonly used with re-frame instead of datomic?


Looks as though the regex I needed was #"^(-{0,1})(\d{0,2})$". I want the textbox to only accept integers in the range (-99 to +99)


A funny rookie mistake is apparently to forget the hash on an anonymous on-click callback fn. Events started flowing like crazy whenever mouse was moved.


@simax99: regex's catch us all! My favourite place to test these is:


Also, there are a few more samples for inspiration here:


@sisawat: re-frame is agnostic of backend database, AFAIK there isn’t any special integration with datomic


I know, I think I was more asking what the clojure stacks of choice where


@gregg thanks for the links