Skip to content

Commit

Permalink
fix: regex handle dot
Browse files Browse the repository at this point in the history
Signed-off-by: ismael FALL <ismael.fall@epitech.eu>
  • Loading branch information
Doozers committed May 5, 2023
1 parent 283213c commit b59ee0e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/multipmuri/pmbodyparser/pmbodyparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b59ee0e

Please sign in to comment.