%% Extract Phone Number from Text
% Define pat as a pattern of numbers with between 3 and 4 digits. Use pat to extract the three parts of a U.S. phone number from a string array.

str = "My phone number is 1-(555)-123-4567";
pat = digitsPattern(3,4);
phoneNum = extract(str,pat)

% Copyright 2019 The MathWorks, Inc.