Problem 42810. String Find with Wildcards of a Cell array
Given a cell array of strings and a search string with single character (?) or multiple character (*) wildness return the indices of the cell array that match.
Examples:
{'abc' 'bdce' 'bkcz'},'b?c' outputs [2 3] 'abc' invalid as ? requires a character {'abcdfhjkfd' 'cf' 'fjhkc' 'fdjk'}, 'c*f' outputs [1 2], no char required for *
Solution Stats
Problem Comments
-
1 Comment
Rafael S.T. Vieira
on 8 Nov 2020
By looking at the solutions, you should probably add a case
c = {'data.mat', 'amat', 'repo.mat', 'matrix', '.mat'}
str = '*.mat'
Solution Comments
Show commentsProblem Recent Solvers14
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
5926 Solvers
-
16173 Solvers
-
4249 Solvers
-
Reverse the Words (not letters) of a String
433 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
214 Solvers
More from this Author294
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!