Skip to content

Commit 3470faf

Browse files
committed
Improved regex
Signed-off-by: Daniel Kastl <[email protected]>
1 parent e70e4dd commit 3470faf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/gtt-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ export class GttClient {
937937
*/
938938
parseHistory() {
939939
document.querySelectorAll('div#history ul.details i').forEach((item: Element) => {
940-
const regex = new RegExp(/\w+[\s](\(*(-?\d+.\d+\s?-?\d+.\d+,?)+\)*)+/g)
940+
const regex = new RegExp(/\b(?:POINT|LINESTRING|POLYGON)\b\s?(\({1,}\d+(?:[,. ]\s?\d+)*\){1,})/g)
941941
const match = item.innerHTML.match(regex)
942942
if (match !== null) {
943943
const feature = new WKT().readFeature(

0 commit comments

Comments
 (0)