-
-
Save flo-l/f11b0f7c54b1633cb8cc to your computer and use it in GitHub Desktop.
regex...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = "pub fn main(some_val: uint, other: str) -> uint" | |
regex = /^(pub\s+)?fn\s+([a-zA-Z0-9_-]+)\((\s*[a-zA-Z0-9_-]+\s*\:\s*[a-zA-Z0-9_-]+\s*,?)*\)(\s+\-\>\s+(\w+))?/ | |
p s.match regex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment