(pattern string)
| 229 | } |
| 230 | |
| 231 | func CompileRegexp(pattern string) (*regexp.Regexp, error) { |
| 232 | re, err := regexp.Compile(pattern) |
| 233 | if err != nil { |
| 234 | if syntaxErr, ok := err.(*syntax.Error); ok { |
| 235 | syntaxErr.Expr = pattern |
| 236 | } |
| 237 | return nil, err |
| 238 | } |
| 239 | return re, err |
| 240 | } |
| 241 | |
| 242 | // NewRegexpBoolean returns a Boolean that compares values that must |
| 243 | // be a stringy the given regexp. |
no test coverage detected