in reply to Re^2: accessing specific data in a file
in thread accessing specific data in a file
The square brackets (not escaped by backslash) define a character class, consisting of the dash, the period and any digit. Note that the dash needs to be first or last inside the brackets in order to be treated as a literal dash; if it were in the middle between to other characters, it would define a range of characters (e.g. <code> a-z </code which matches all lower-case letters)./\[ #open sq bracket ((?:\s*[-.\d]+){3}) #match 3 numerics, incl. decimal point and/o +r minus sign , ((?:\s*[-.\d]+){3}) \] /gx
You can definitely benefit from reading the perlre and perlretut man pages. Please do that.
update: Actually, looking at your more detailed data sample, it looks like the regex given above won't work -- there are a lot more sets of numerics between a given pair of square brackets. I'm afraid I don't understand how that many sets of values can constitute a single "Coordinate". If you need more help, you first need to be more clear about how the data are supposed to be interpreted, and what you really intend to do with the sets of values that are given to you that way.
|
|---|