Last active
April 20, 2017 09:18
-
-
Save serverhorror/fef6e76a6d6af1edf9abc3bdc66ba7db to your computer and use it in GitHub Desktop.
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
// Unsupported Pattern because of negative look-ahead | |
// PATTERN = "(.*?)((BI)-(\w+)-(\d{4}-\d{4}-\d{4}(?!-\d{4})))" | |
// Workaround? | |
for _, line := range lines { | |
// If we have 3 digit groups we found a candidate! | |
if match, _ := regexp.MatchString("(.*?)((BI)-(\w+)-(\d{4}-\d{4}-\d{4}", text); match == true { | |
// But if we have 4 digit groups this shouldn't be handled! | |
// This is what the negative lookahead would prevent in the first place | |
if match, _ := regexp.MatchString("(.*?)((BI)-(\w+)-(\d{4}-\d{4}-\d{4}-\d{4}", text); match == true { | |
continue | |
} | |
handle(line) | |
} | |
} | |
func handle(line string) { | |
return // magic | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment