`String#match` vs `String#scan` · Issue #185 · fastruby/fast-ruby · GitHub
Skip to content

String#match vs String#scan #185

Open

Description

@AlexWayfer

Hello.

These methods are pretty similar.

I've done some benchmarks and figured out that match is twice faster than scan.

I can try to make a PR, but not sure do we need for it here.

Activity

  1. ParadoxV5 commented on Aug 20, 2020

    @ParadoxV5

    Friendly reminder: String#match outputs a MatchData while String#scan outputs an Array.

  2. AlexWayfer commented on Aug 20, 2020

    @AlexWayfer
    Author

    Friendly reminder: String#match outputs a MatchData while String#scan outputs an Array.

    Yes, but they're similar, but an outside code will be different for the same input data (String and Regexp). But the point of comparison of these approaches is they complete the similar goal.

  3. mateusdeap commented on Nov 7, 2022

    @mateusdeap
    Contributor

    @AlexWayfer If you're still interested in this, feel free to open a PR. All you need to do is follow the guidelines in the CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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