bids-matlab icon indicating copy to clipboard operation
bids-matlab copied to clipboard

Let ends_with accept a series of pattern to check

Open Remi-Gau opened this issue 4 years ago • 1 comments

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

Remi-Gau avatar Apr 16 '21 14:04 Remi-Gau

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

nbeliy avatar Apr 19 '21 07:04 nbeliy