package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?i)\<yes or no\. if yes, explain why\>|\<yes\/no\>`)
var str = `* Document with a Yes or No if your story impacts any of the following hazard types. If yes, explain why.
** Financial: <yes or no. If yes, explain why>
** Legal/Regulatory: <yes or no. If yes, explain why>
** Data Integrity: <yes or no. If yes, explain why>
** Patient Safety: <yes or no. If yes, explain why>
** CyberSecurity/Information Security: <yes or no. If yes, explain why>
* Engineer assigned to the project has added a +1 indicating that they discussed the impact this story has with regards to Hazards and agrees with the assessment.
- *Financial:* <yes or no. If yes, explain why>
- *Legal/Regulatory:* <yes or no. If yes, explain why>
- *Data Integrity:* <yes or no. If yes, explain why>
- *Patient Safety:* <yes or no. If yes, explain why>
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* <yes/no>
- *Legal/Regulatory:* <yes/no>
- *Data Integrity:* <yes/no>
- *Patient Safety:* <yes/no>
- *CyberSecurity/Information Security:* <yes/no>
- *Financial:* <yes or no. If yes, explain why>No
- *Legal/Regulatory:* <yes or no. If yes, explain why> Yes
- *Data Integrity:* No
- *Patient Safety:* Yes, this was an issue because of XYZ.
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* no
- *Legal/Regulatory:* no
- *Data Integrity:* no
- *Patient Safety:* no
- *CyberSecurity/Information Security:* no
- *Financial:* N
- *Legal/Regulatory:* N
- *Data Integrity:* N
- *Patient Safety:* N
- *CyberSecurity/Information Security:* N
- *Financial:* <yes or no. If yes, explain why>N
- *Legal/Regulatory:* <yes or no. If yes, explain why> N
- *Data Integrity:* <yes or no. If yes, explain why>N
- *Patient Safety:* <yes or no. If yes, explain why>N
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why> N
- *Financial:* <yes or no. If yes, explain why>
- *Legal/Regulatory:* <yes or no. If yes, explain why>
- *Data Integrity:* <yes or no. If yes, explain why>
- *Patient Safety:* <yes or no. If yes, explain why>
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* <yes/no>
- *Legal/Regulatory:* <yes/no>
- *Data Integrity:* <yes/no>
- *Patient Safety:* <yes/no>
- *CyberSecurity/Information Security:* <yes/no>
- *Financial:* <yes or no. If yes, explain why>No
- *Legal/Regulatory:* <yes or no. If yes, explain why> Yes
- *Data Integrity:* No
- *Patient Safety:* Yes, this was an issue because of XYZ.
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* no
- *Legal/Regulatory:* no
- *Data Integrity:* no
- *Patient Safety:* no
- *CyberSecurity/Information Security:* no
- *Financial:* N
- *Legal/Regulatory:* N
- *Data Integrity:* N
- *Patient Safety:* N
- *CyberSecurity/Information Security:* N
- *Financial:* <yes or no. If yes, explain why>N
- *Legal/Regulatory:* <yes or no. If yes, explain why> N
- *Data Integrity:* <yes or no. If yes, explain why>N
- *Patient Safety:* <yes or no. If yes, explain why>N
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why> N
`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/