Skip to content

Commit

Permalink
Update base32 regex
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Jul 26, 2022
1 parent 3638155 commit ffe9cb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions email/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ var (

// extractSkylink32RE and extractSkylink32RE_2 are regexes capable of
// extracting base-32 encoded skylinks from text
extractSkylink32RE = regexp.MustCompile(`.+?://.*?([a-zA-Z0-9-_]{55})`)
extractSkylink32RE_2 = regexp.MustCompile(`(http.+|hxxp.+|\..+|://.+|^)([a-zA-Z0-9-_]{55})(\?.*)?$`)
extractSkylink32RE = regexp.MustCompile(`(?i).+?://.*?([a-z0-9]{55})`)
extractSkylink32RE_2 = regexp.MustCompile(`(?i)(http.+|hxxp.+|\..+|://.+|^)([a-z0-9]{55})(\?.*)?$`)

// space matches all whitespace
space = regexp.MustCompile(`\s+`)

validateSkylink64RE = regexp.MustCompile(`^([a-zA-Z0-9-_]{46})$`)
validateSkylink32RE = regexp.MustCompile(`^([a-zA-Z0-9-_]{55})$`)
validateSkylink32RE = regexp.MustCompile(`(?i)^([a-z0-9]{55})$`)
)

type (
Expand Down

0 comments on commit ffe9cb0

Please sign in to comment.