Hi Chris,
Indeed, the problem was on my side.
Thank you,
Gregoire
Indeed, the problem was on my side.
Thank you,
Gregoire
| Poster | Content | |||
|---|---|---|---|---|
|
nk4um User
Posts: 111
|
Hi Chris,
Indeed, the problem was on my side. Thank you, Gregoire |
|||
|
nk4um User
Posts: 156
|
Looks like this regex is missing a slash on the ''.''. So should be:
Hope that helps, Chris |
|||
|
nk4um User
Posts: 111
|
Hi Tony,
I saw that, when I use :
the following matches :
and so "myFloat" contains "10/2". Is this intented that "\\d" grabs "/"? I thought that it was [0-9]. Thanks, Gregoire |
|||
|
nk4um User
Posts: 111
|
Hi Tony,
It works with the given regex. Thank you. Gregoire |
|||
|
nk4um Moderator
Posts: 485
|
Ah, I see you were looking at the grammar quick reference in the grammar kitchen!
The regex element has no encoding attribute (it is only on the group element) It looks like that reference is out of date - look at the detailed doc (linked at top of quick ref) I''ll get the quick reference synchronized. Cheers, Tony |
|||
|
nk4um Moderator
Posts: 485
|
Sorry the regex examples I showed contain double backslashes (java literal encoding) the real regex''s are just a single backslash!
|
|||
|
nk4um Moderator
Posts: 485
|
As far as the documentation. Yes we''re always looking to improve and add detail.
The grammar parser always returns strings back as it is simply a matter of break up the identifier into substrings. Encoding is a not-quite pluggable mechanism for allowing types of encoding/decoding of these substrings. I.e. the escaping that is done to nested identifiers inside identifiers in the active URI syntax. Currently that is the only supported encoding. Cheers, Tony |
|||
|
nk4um Moderator
Posts: 485
|
Yep it looks like a bug -regex is "\\\\d+(\\\\.\\\\d+)?" Looks like integer is ok - regex is "[+-]?\\\\d+". I guess integer
needs the "[+-]?" added to the start.
Thanks for reporting. As a workaround you can use <regex>[+-]?\\\\d+(\\\\.\\\\d+)?</regex> Cheers, Tony |
|||
|
nk4um User
Posts: 111
|
Hi,
I need to be able to parse negative floats in my URL, so I have written this grammar:
1) However, the following test in the grammar''s kitchen doesn''t work :
Is this a bug? 2) The documentation could be more explicit about whether negative values are accepted or not.
3) Another good documentation improvement would be to tell what is the Java class returned by the parser. 4) And it wouuld be good to explain what is possible with the "encoding" attribute of the <regex> element. Thanks, Gregoire |