Ticket #59 (closed defect: invalid)

Opened 5 years ago

Last modified 4 years ago

Regular expression changes

Reported by: psterk Owned by: pyilmaz
Priority: major Component: MIxS general
Version: 4.0 Keywords: regular expression
Cc: Sensitive: no

Description

EBI SRA would like to suggest a change for the numeric values that
attributes (like 'ventilation rate' or 'humidity') can have in the
metagenomics checklists.

The current regexp is:
[1-9][0-9]*\.?[0-9]*([Ee][+-]?[0-9]+)?

But it prevents these numeric values:
0.1 does not match
0 does not match

The proposed change is:
(0|((0
.)|([1-9][0-9]*
.?))[0-9]*)([Ee][+-]?[0-9]+)?
(if we don't want to accept leading zeros)

or simply
[0-9]*
.?[0-9]*([Ee][+-]?[0-9]+)?
(if we accept leading zeros)

Change History

comment:1 Changed 5 years ago by psterk

Sorry I just realized that there are extra back slashes that should be removed. Also, the the original posting was screwed up (I should have used code clock formatting.

(0|((0\\.)|([1-9][0-9]*\\.?))[0-9]*)([Ee][+-]?[0-9]+)?
should actually be
(0|((0\.)|([1-9][0-9]*\.?))[0-9]*)([Ee][+-]?[0-9]+)?

and
[0-9]*\\.?[0-9]*([Ee][+-]?[0-9]+)?
should be
[0-9]*\.?[0-9]*([Ee][+-]?[0-9]+)?

Last edited 5 years ago by psterk (previous) (diff)

comment:2 Changed 4 years ago by pyilmaz

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.