Step 3
Filtering Out the Noise with Regex
Cleaning our data
(^[,:\s]*|[,:\s]*$)
-
match the regular expression below and capture its match into backreference number 1
-
match either the regular expression below (attempting the next alternative only if this one fails)
-
assert position at the beginning of the string
-
match a single character present in the list below
-
between zero and unlimited times, as many times as possible, giving back as needed (greedy)
-
one of the characters ",:"
-
a whitespace character (spaces, tabs, line breaks, etc.)
-
or match regular expression number 2 below (the entire group fails if this one fails to match)
-
match a single character present in the list below
-
between zero and unlimited times, as many times as possible, giving back as needed (greedy)
-
one of the characters ",:"
-
a whitespace character (spaces, tabs, line breaks, etc.)
-
assert position at the end of the string (or before the line break at the end of the string, if any)
← Back to post