Complete the code to find matches of the pattern 'cat' in the text.
matches = regexp(text, '[1]');
The pattern 'cat' correctly matches the substring 'cat' in the text.
Complete the code to extract all words starting with 'a' or 'A' from the text.
words = regexp(text, '[1]', 'match');
The pattern '\b[aA]\w*\b' matches words starting with 'a' or 'A'.
Fix the error in the code to find the position of the first digit in the string.
pos = regexp(str, '[1]');
The pattern '\d' matches any digit character, so it finds the first digit position.
Fill both blanks to extract all email addresses from the text.
emails = regexp(text, '[1]', '[2]');
The pattern matches typical email addresses, and 'match' returns the matched strings.
Fill all three blanks to replace all whitespace sequences with a single dash '-' in the string.
newStr = regexprep(str, '[1]', '[2]', '[3]');
'\s+' matches one or more whitespace characters, '-' is the replacement, and 'all' replaces all occurrences.