Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Vincent H
On Tuesday, August 5, 2014 7:49:21 AM UTC+2, larry google groups wrote: I'm working on a website with a frontender who asked to be able to save JSON maps that contain field names such as: $$hashKey : 00C The dollar signs are a violation of MongoDB limits on field names, so i need to

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Andy Fingerhut
Or even more simply, since the thing you want to replace is a single character, you do not need a regex to match it, but can match a string that is not a regex at all, e.g.: (st/replace **username * $) The doc string for clojure.string/replace is fairly explicit on this. Andy On Mon, Aug 4,

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Daniel Compton
Hi Larry From the scheme you described you will run into problems if your field name actually contains a *. When you go to reconvert the string, it would replace genuine *'s with $'s that aren't there. Daniel. On 5/08/2014, at 6:50 pm, Andy Fingerhut andy.finger...@gmail.com wrote: Or

how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-04 Thread larry google groups
I'm working on a website with a frontender who asked to be able to save JSON maps that contain field names such as: $$hashKey : 00C The dollar signs are a violation of MongoDB limits on field names, so i need to convert to something else and then convert back. So I thought I would convert to