diff --git a/src/utilities/is/ismonthly.m b/src/utilities/is/ismonthly.m index 60694cfdd156161a8fbe5a723876333e823a747e..dcf9c4e7312d3df35e67bc658fa8ae452d074710 100644 --- a/src/utilities/is/ismonthly.m +++ b/src/utilities/is/ismonthly.m @@ -26,7 +26,7 @@ function b = ismonthly(str) % --*-- Unitary tests --*-- % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ischar(str) - if isempty(regexp(str,'^-?[0-9]*[Mm]([1-9]|1[0-2])$','once')) + if isempty(regexp(str,'^-?[0-9]+[Mm]([1-9]|1[0-2])$','once')) b = false; else b = true; diff --git a/src/utilities/is/isquarterly.m b/src/utilities/is/isquarterly.m index 1a0a8b3a1c0a723f99bf537722ea83ffda9f95e5..82811c93e8c98b4b037d9fb4dce31af771182cf7 100644 --- a/src/utilities/is/isquarterly.m +++ b/src/utilities/is/isquarterly.m @@ -26,7 +26,7 @@ function b = isquarterly(str) % --*-- Unitary tests --*-- % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ischar(str) - if isempty(regexp(str,'^-?[0-9]*[Qq][1-4]$','once')) + if isempty(regexp(str,'^-?[0-9]+[Qq][1-4]$','once')) b = false; else b = true; diff --git a/src/utilities/is/isstringdate.m b/src/utilities/is/isstringdate.m index ffbcefc87263c71b55c463f7648d82c0cd415eec..3221c94e9a18419b2094b0ddefe442712b49cc92 100644 --- a/src/utilities/is/isstringdate.m +++ b/src/utilities/is/isstringdate.m @@ -41,6 +41,13 @@ end %$ date_6 = '1950Y'; %$ date_7 = '-1950a'; %$ date_8 = '1950m '; +%$ date_9 = 'A'; +%$ date_10 = '1938Q'; +%$ date_11 = 'Q4'; +%$ date_12 = '1938M'; +%$ date_13 = 'M11'; +%$ date_14 = '1W'; +%$ date_15 = 'W1'; %$ %$ t(1) = dassert(isstringdate(date_1),true); %$ t(2) = dassert(isstringdate(date_2),true); @@ -50,5 +57,13 @@ end %$ t(6) = dassert(isstringdate(date_6),true); %$ t(7) = dassert(isstringdate(date_7),true); %$ t(8) = dassert(isstringdate(date_8),false); +%$ t(9) = dassert(isstringdate(date_9),false); +%$ t(10) = dassert(isstringdate(date_10),false); +%$ t(11) = dassert(isstringdate(date_11),false); +%$ t(12) = dassert(isstringdate(date_12),false); +%$ t(13) = dassert(isstringdate(date_13),false); +%$ t(14) = dassert(isstringdate(date_14),false); +%$ t(15) = dassert(isstringdate(date_15),false); +%$ %$ T = all(t); %@eof:1 \ No newline at end of file diff --git a/src/utilities/is/isweekly.m b/src/utilities/is/isweekly.m index 8c0a398b6d21b522ec45c3a540be49c0c5f23736..a8fdc02934f8c62a86e0d7cafe8e4b274b894528 100644 --- a/src/utilities/is/isweekly.m +++ b/src/utilities/is/isweekly.m @@ -26,7 +26,7 @@ function b = isweekly(str) % --*-- Unitary tests --*-- % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ischar(str) - if isempty(regexp(str,'^-?[0-9]*[Ww]([1-9]|[1-4][0-9]|5[0-2])$','once')) + if isempty(regexp(str,'^-?[0-9]+[Ww]([1-9]|[1-4][0-9]|5[0-2])$','once')) b = false; else b = true; diff --git a/src/utilities/is/isyearly.m b/src/utilities/is/isyearly.m index a1eb711938c5e6fb59394224d9840f4090fbd1d1..181b7b4ea8834711945c029f53510cbd90f8fac3 100644 --- a/src/utilities/is/isyearly.m +++ b/src/utilities/is/isyearly.m @@ -26,7 +26,7 @@ function b = isyearly(str) % --*-- Unitary tests --*-- % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ischar(str) - if isempty(regexp(str,'^-?[0-9]*[YyAa]$','once')) + if isempty(regexp(str,'^-?[0-9]+[YyAa]$','once')) b = false; else b = true;