morilog / jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in php appliations, based on Jalali (Shamsi) DateTime class.
MIT License
860 stars 110 forks source link

Regex problem on parseFromFormat method from CalendarUtils class #63

Closed dena-a closed 3 years ago

dena-a commented 5 years ago

The Exception is on line 735.

Exception Message:

preg_match(): Compilation failed: two named subpatterns have the same name at offset 50

Exception trace:

preg_match("#^(?P\d{4})/(?P[A-Z][a-z]{3})(?P[A-Z][a-z]{3})/(?P[A-Z][a-z]{2})(?P[A-Z][a-z]{2})$#", "1397/09/21", [])

dena-a commented 5 years ago

The method does not support all php date formats; and there is no any exceptions.

morilog commented 5 years ago

Yes, that method is experimental and not covers all php date format. I will work on this method in my free time.