# Regexp Failed To Parse for Campaign Contact Field Regexp Match

**URL:** <https://forum.mautic.org/t/regexp-failed-to-parse-for-campaign-contact-field-regexp-match/22719>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [February 15, 2022, 11:10am UTC](https://forum.mautic.org/t/regexp-failed-to-parse-for-campaign-contact-field-regexp-match/22719 "2022-02-15T11:10:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewchildsza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/andrewchildsza/32/33_2.png) [@andrewchildsza](https://forum.mautic.org/u/andrewchildsza)\
**Post date:** [February 15, 2022, 11:10am UTC](https://forum.mautic.org/t/regexp-failed-to-parse-for-campaign-contact-field-regexp-match/22719/1 "2022-02-15T11:10:45Z")

</div>

**Your software**  
My Mautic version is: 4.1.2  
My PHP version is: 7.4  
My Database type and version is: MariaDB 10.3.32

**Your problem**  
My problem is:  
I’ve attempted to filter contacts by using a “Contact field value” condition in the campaign builder.  
I need to filter by match against a “date-added” contact field.

I have built a Regex pattern to match the appropriate values. Please see here: [regex101: build, test, and debug regex](https://regex101.com/r/Qp9oCD/1)

Mautic produces a consistent error for this. See log output for error log.

Reproduce by:  
Step 1: Create campaign with a “Contact field value” condition.  
Step 2: Set the condition to match a field containing a date formatted in the following: F j, Y G:i:s (eg: February 13, 2022 9:22:41).  
Step 3: Save the campaign and allow it to run or run it manually.

These errors are showing in the log:  
[2022-02-14 10:35:21] mautic.CRITICAL: Uncaught PHP Exception Exception: “DateTime::\_\_construct(): Failed to parse time string (8) at position 0 (8): Unexpected character” at /var/www/mautic-xxx.xxx.xxx/app/bundles/CampaignBundle/Entity/Event.php line 1015 {“exception”:"[object] (Exception(code: 0): DateTime::\_\_construct(): Failed to parse time string (8) at position 0 (8): Unexpected character at /var/www/mautic-xxx.xxx.xxx/app/bundles/CampaignBundle/Entity/Event.php:1015)"}   
[2022-02-14 11:47:32] mautic.ERROR: CAMPAIGN: DateTime::\_\_construct(): Failed to parse time string (\b([8-9]|[1][0-6]):[0-5]0-9?(?i)\b) at position 0 (): Unexpected character

Updated/different regex string:  
[2022-02-15 07:39:32] mautic.ERROR: CAMPAIGN: DateTime::\_\_construct(): Failed to parse time string ((0?[8-9]|1[0-6]):([0-5][0-9]):([0-9][0-9])) at position 0 ((): Unexpected character

Steps I have tried to fix the problem:  
Tried different regex strings ad nauseum.
