Skip to main content

find_jira

Function find_jira 

Source
pub fn find_jira(s: &str) -> Option<String>
Expand description

[A-Z]{3,32}-[1-9][0-9]{1,31}, by hand.

A ‘-’ is not uppercase, so the letter run always ends exactly at it: for a start position, take the run and require its length in 3..=32. A 40-letter prefix therefore fails at offset 0 and matches at offset 8, which is what the regex’s leftmost-match does too.