Created
April 13, 2011 15:38
-
-
Save kybernetyk/917774 to your computer and use it in GitHub Desktop.
MACHS GANS!
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
func main() { | |
r := `<.*?>` | |
s := "<b>ich mag <3 tiere</b><a href='http://www.heise.de'>lol</a>" | |
re, err := regexp.Compile(r) | |
if err != nil { | |
fmt.Println(err.String()) | |
return | |
} | |
strs := re.FindAllString(s, -1) | |
for _, t := range strs { | |
fmt.Println(t) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment