Skip to content

[BUG] regexp pattern not handled #794

@marcelzwiers

Description

@marcelzwiers

Is there an existing issue for this?

  • I have searched the existing issues

Operating system

  • Linux
  • Mac
  • Windows

Operating system version

irrelevant

Platform

  • MATLAB
  • Octave

Platform version

bids-matlab version

v0.1.0dev

branch / commit number

I'm sorry to say so, but this is the most unfriendly issue form I have ever encountered. It looks fancy, but it is waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay too long and detailed/irrelevant.

Expected Behavior

All is ok when I query for files with no part-mag entity:

>> bids.query(BIDS,'data','part','', 'suffix','T1w')

ans =

  2×1 cell array

    {'C:\Users\marzwi\bidscointutorial\bids_ref\sub-001\anat\sub-001_acq-mprage_T1w.nii'}
    {'C:\Users\marzwi\bidscointutorial\bids_ref\sub-002\anat\sub-002_acq-mprage_T1w.nii'}

However, when I query for no or only mag (i.e. no phase) then it goes wrong:

>> bids.query(BIDS,'data','part','(mag)?', 'suffix','T1w')

ans =

  0×0 empty cell array

And it's not that the (somethinghere)? pattern is not working, as you can see here:

>> bids.query(BIDS,'data','acq','(mprage)?', 'suffix','T1w')

ans =

  2×1 cell array

    {'C:\Users\marzwi\bidscointutorial\bids_ref\sub-001\anat\sub-001_acq-mprage_T1w.nii'}
    {'C:\Users\marzwi\bidscointutorial\bids_ref\sub-002\anat\sub-002_acq-mprage_T1w.nii'}

Current Behavior

See above

Error message

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions