For a special function to build better and smarter PDO statements I've matched and extracted every word, which started with a colon.
PHP like Needle: /:\w+/
But sometimes it also happens that I've to handle strings with colon-seperated digits. (time-values)
2018-05-21T00:00:00+02:00
00:00:00
00:00
I've tried to exclude them, but never succeeded when I tried to extend my regex-needle for this. Because of that issue, I just often workaround this issue. But now I would like to fix and understand how to solve this.
The condition sounds easy
- Find every word, which starts with a colon.
- Remove every match which has digits before the colon.
So from the current result with :\w+
:
:light
at 07:15:0000
I would like just to match:
:light
at 07:15:0000