bids-matlab
bids-matlab copied to clipboard
Let ends_with accept a series of pattern to check
Will it be a more complexity/performance issue to make it also accept cellstr for pat?
Originally posted by @nbeliy in https://github.com/bids-standard/bids-matlab/pull/172#discussion_r584524205
I found that in matlab the string operations are sometimes more effectively treated by regexp than by dedicated functions. Probably because regexp is compiled. It could be beneficial to create a set of low level BIDS string operations and compile them:
- getting modality (string before '/')
- getting extension (string after first '.')
- getting suffix (string between last '_' and first '.')
- splitting entities in pairs key - value
I tried to write some of them (just a trivial string scan) but the performance is on par with regexp