I'd play with the MessageFormat Javadocs:

> Within a String, "''" represents a single quote. A QuotedString can contain 
> arbitrary
> characters except single quotes; the surrounding single quotes are removed. An
> UnquotedString can contain arbitrary characters except single quotes and left 
> curly
> brackets. Thus, a string that should result in the formatted message "'{0}'" 
> can be
> written as "'''{'0}''" or "'''{0}'''".

I'd try some combinations of that; I recall having a similar issue at
one point but don't remember what finally resolved it.

Dave

On Wed, Apr 20, 2011 at 4:14 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> All,
>
> I've been using S1 for years to great satisfaction. Thanks!
>
> I'm coming up against a problem that I think I can't get around, so I'm
> posing it to the community to see if anyone can help.
>
> We have a regular expression that we want to put into a properties file
> so we can
>
> a) Use it as a <var> in our validation configuration
>
> and
>
> b) Use it from within our web forms as part of a "pattern" element for
>   HTML5-compatible browsers
>
> Everything seems to work great until we introduce {...} multiplicity
> selectors in the regular expression (specifically, "[whatever]{5,17}").
> First, we get an error from MessageFormat saying that it can't parse the
> "5,17" into a meaningful format.
>
> Once we escape the braces like this "[whatever]'{'5,17'}'" we get a new
> error that was hard to diagnose because we didn't know that Struts was
> escaping single-quotes in MessageResources.getMessage().
>
> I think we're stuck, short of re-writing our expressions to use a LOT of
> alternatives, making them a total PITA to maintain.
>
> Any suggestions? Are we overlooking anything, here?
>
> We're using version 1.3.8 specifically if that changes anything.
>
> Thanks,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2vPqcACgkQ9CaO5/Lv0PAg3ACgsHfzE+TcwGGIFJfqYQgk9Uwj
> 31IAoI8pWkQzrLFl46IUzVzgP4J8n//7
> =Yelu
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to