Skip to content

Commit b3d61ab

Browse files
adedamola-sodeOCopping
authored andcommitted
modified regex to enable parsing [], [,], *{part_PV}*
1 parent a8fb737 commit b3d61ab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/techui_builder/objects.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@ def _extract_p_and_r(self):
6464
r"""
6565
^ # start of string
6666
(?= # lookahead to ensure the following pattern matches
67-
[A-Za-z0-9-\*\?\[\]]{13,16} # match 13-16 alphanumeric chars,-/wildcards
68-
[:A-Za-z0-9\*\?\[\]]* # match >=0 colons or alphanumeric chars/wildcards
69-
[.A-Za-z0-9\*\?\[\]] # match a dot or alphanumeric chars or wildcards
67+
[A-Za-z0-9*?\[\]-]{2,16} # match 13-16 alphanumeric chars,-/wildcards
68+
[:A-Za-z0-9*?[\]]* # match >=0 colons or alphanumeric chars/wildcards
69+
[.A-Za-z0-9*?[\]] # match a dot or alphanumeric chars or wildcards
7070
)
7171
(?!.*--) # negative lookahead to ensure no double hyphens
7272
(?!.*:\..) # negative lookahead to ensure no colon followed by a dot
7373
( # start of capture group 1
74-
(?:[A-Za-z0-9]{2,5}-){3} # match 2 to 5 alphanumeric characters followed
74+
(?:[A-Za-z0-9*?,\[\]-])* # match 2 to 5 alphanumeric characters followed
7575
# by a hyphen, repeated 3 times
76-
[\d]* # match zero or more digits
76+
[\d*]* # match zero or more digits
7777
[^:]? # match zero or one non-colon character
7878
)
79-
(?::([a-zA-Z0-9:]*))? # match zero or one colon followed by zero or more
79+
(?::([a-zA-Z0-9*:]*))? # match zero or one colon followed by zero or more
8080
# alphanumeric characters or colons (capture group 2)
81-
(?:\.([a-zA-Z0-9]+))? # match zero or one dot followed by one or more
81+
(?:\.([a-zA-Z0-9*]+))? # match zero or one dot followed by one or more
8282
# alphanumeric characters (capture group 3)
8383
$ # end of string
8484
""",
85-
re.VERBOSE,
85+
re.VERBOSE | re.UNICODE,
8686
)
8787

8888
match = re.match(pattern, self.prefix)

0 commit comments

Comments
 (0)