From bb719b4e07b81575b3651ae384cf7cdccef20228 Mon Sep 17 00:00:00 2001 From: Isma <71719097+Doozers@users.noreply.github.com> Date: Tue, 9 May 2023 09:44:26 +0200 Subject: [PATCH] fix: regex handle dot (#665) Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com> --- pkg/multipmuri/pmbodyparser/pmbodyparser.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/multipmuri/pmbodyparser/pmbodyparser.go b/pkg/multipmuri/pmbodyparser/pmbodyparser.go index d000f3ea3..138e38d3c 100644 --- a/pkg/multipmuri/pmbodyparser/pmbodyparser.go +++ b/pkg/multipmuri/pmbodyparser/pmbodyparser.go @@ -57,14 +57,14 @@ func ParseString(body string) (Relationships, []error) { } var ( - fixesRegex, _ = regexp.Compile(`(?im)^\s*(fix|fixes)\s*[:= ]\s*([^\s,]+)\s*$`) - blocksRegex, _ = regexp.Compile(`(?im)^\s*(block|blocks)\s*[:= ]\s*([^\s,]+)\s*$`) - closesRegex, _ = regexp.Compile(`(?im)^\s*(close|closes)\s*[:= ]\s*([^\s,]+)\s*$`) - parentOfRegex, _ = regexp.Compile(`(?im)^\s*(parent of|parent)\s*[:= ]\s*([^\s,]+)\s*$`) - partOfRegex, _ = regexp.Compile(`(?im)^\s*(part of|part)\s*[:= ]\s*([^\s,]+)\s*$`) - relatedWithRegex, _ = regexp.Compile(`(?im)^\s*(related|related with)\s*[:= ]\s*([^\s,]+)\s*$`) - addressesRegex, _ = regexp.Compile(`(?im)^\s*(address|addresses)\s*[:= ]\s*([^\s,]+)\s*$`) - dependsOnRegex, _ = regexp.Compile(`(?im)^\s*(depend|depends|depend on|depends on)\s*[:= ]\s*([^\s,]+)\s*$`) + fixesRegex, _ = regexp.Compile(`(?im)^\s*(fix|fixes)\s*[:= ]\s*([^\s,.]+).?\s*$`) + blocksRegex, _ = regexp.Compile(`(?im)^\s*(block|blocks)\s*[:= ]\s*([^\s,.]+).?\s*$`) + closesRegex, _ = regexp.Compile(`(?im)^\s*(close|closes)\s*[:= ]\s*([^\s,.]+).?\s*$`) + parentOfRegex, _ = regexp.Compile(`(?im)^\s*(parent of|parent)\s*[:= ]\s*([^\s,.]+).?\s*$`) + partOfRegex, _ = regexp.Compile(`(?im)^\s*(part of|part)\s*[:= ]\s*([^\s,.]+).?\s*$`) + relatedWithRegex, _ = regexp.Compile(`(?im)^\s*(related|related with)\s*[:= ]\s*([^\s,.]+).?\s*$`) + addressesRegex, _ = regexp.Compile(`(?im)^\s*(address|addresses)\s*[:= ]\s*([^\s,.]+).?\s*$`) + dependsOnRegex, _ = regexp.Compile(`(?im)^\s*(depend|depends|depend on|depends on)\s*[:= ]\s*([^\s,.]+).?\s*$`) ) func RelParseString(context multipmuri.Entity, body string) (Relationships, []error) {