Skip to content

regex tips #5

Description

@dcarosone

Two tips for regex usage:

  • you're working with non-utf8 bytes, [u8]; look at the bytes submodule in the Regex crate. This will avoid a bunch of the mess inside each match arm that's trying to conver to strings and back.
  • avoid compiling the regex each time around the loop, using the lazy_static! method noted in the regex docs.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions