1 |
|
2 | /**
|
3 | * Object of regular expressions for FSW strings
|
4 | *
|
5 | * { symbol, coord, sort, box, prefix, spatial, signbox, sign, sortable }
|
6 | * @alias fsw.re
|
7 | * @type {object}
|
8 | */
|
9 | let re = {
|
10 | 'symbol': 'S[123][0-9a-f]{2}[0-5][0-9a-f]',
|
11 | 'coord': '[0-9]{3}x[0-9]{3}',
|
12 | 'sort': 'A',
|
13 | 'box': '[BLMR]'
|
14 | }
|
15 | re.prefix = `(?:${re.sort}(?:${re.symbol})+)`;
|
16 | re.spatial = `${re.symbol}${re.coord}`;
|
17 | re.signbox = `${re.box}${re.coord}(?:${re.spatial})*`;
|
18 | re.sign = `${re.prefix}?${re.signbox}`;
|
19 | re.sortable = `${re.prefix}${re.signbox}`;
|
20 |
|
21 | export { re }
|