equal
deleted
inserted
replaced
83 numbers and underscores. |
83 numbers and underscores. |
84 |
84 |
85 %You might also be surprised what |
85 %You might also be surprised what |
86 %constraints programming languages impose about numbers: for example |
86 %constraints programming languages impose about numbers: for example |
87 %123 in JSON is OK, but 0123 is not. |
87 %123 in JSON is OK, but 0123 is not. |
|
88 % |
|
89 % The regex for JASON numbers is |
|
90 % |
|
91 % -?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)? |
88 |
92 |
89 Often we also face the problem that we are given a string, for example |
93 Often we also face the problem that we are given a string, for example |
90 some user input, and we want to know whether it matches a particular |
94 some user input, and we want to know whether it matches a particular |
91 pattern---is it an email address, for example. In this way we can |
95 pattern---is it an email address, for example. In this way we can |
92 exclude user input that would otherwise have nasty effects on our |
96 exclude user input that would otherwise have nasty effects on our |