Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created December 27, 2011 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/1523992 to your computer and use it in GitHub Desktop.
Save tadzik/1523992 to your computer and use it in GitHub Desktop.
Regex from string
my $hello = "'/'hello'/'(<-[\\/\\.]>+)";
my $reg = / ^ <$hello> $ /;
"/hello/bug" ~~ $reg;
say $/[0];
"/hello/bug" ~~ / ^ '/'hello'/'(<-[\\/\\.]>+) $ /;
say $/[0].perl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment