GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `String#match` vs `String#scan` · Issue #185 · fastruby/fast-ruby

String#match vs String#scan #185

New issue
Copy link
New issue
Copy link
Open
Open
String#match vs String#scan#185
Copy link

Description

@AlexWayfer
AlexWayfer
opened on Aug 20, 2020
Issue body actions

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
    ParadoxV5
    on Aug 20, 2020
    More actions

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

  2. AlexWayfer commented on Aug 20, 2020

    @AlexWayfer
    AlexWayfer
    on Aug 20, 2020
    Author
    More actions

    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
    mateusdeap
    on Nov 7, 2022
    Contributor
    More actions

    @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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.