Skip to content

How to match exact start of string? #246

@az-nextsec

Description

@az-nextsec

Trying to match

react
react/react-shoes
react-shoes

but not

@testing-library/react
@banana/react

Pattern react matches first and last 2:

console.log(
  minimatch.match(
    [
      'react',
      'react/react-shoes',
      'react-shoes',
      '@testing-library/react',
      '@banana/react',
    ],
    'react',
    { matchBase: true }
  )
);

prints out

[ 'react', '@testing-library/react', '@banana/react' ]

Pattern react* matches ALL the strings.

Things like react[!@] match nothing :(

Am a bit stuck

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions