Skip to content

Commit

Permalink
Update JCAMP-DX regex pattern to allow for whitespace at the start of…
Browse files Browse the repository at this point in the history
… lines
  • Loading branch information
SombkeMaximilian committed Mar 5, 2025
1 parent 3807ef8 commit cbe1667
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metabodecon/src/spectrum/formats/jcampdx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,10 @@ static ENCODING: LazyLock<[Regex; 6]> = LazyLock::new(|| {
Regex::new(r"(?P<asdf>[@%A-Za-z+-])").unwrap(), // ASDF
Regex::new(r"(?P<pac>[+-]\d)").unwrap(), // PAC
Regex::new(r"(?P<sqz>[@A-Ia-i])").unwrap(), // SQZ
Regex::new(r"\s+(?P<dif>[%J-Rj-r]\d*)\s*(?P<dup>([S-Zs]\d*)?)((\r\n|\n|\r)(?P<next>\d+))")
.unwrap(), // DIFDUP Checkpoints
Regex::new(
r"\s+(?P<dif>[%J-Rj-r]\d*)\s*(?P<dup>([S-Zs]\d*)?)\s*((\r\n|\n|\r)\s*(?P<next>\d+))",
)
.unwrap(), // DIFDUP Checkpoints
Regex::new(r"\s+(?P<val>[+-]*\d*)\s+(?P<dif>[%J-Rj-r]\d*)").unwrap(), // DIF
Regex::new(r"\s+(?P<val>[+-]*\d+)\s+(?P<dup>[S-Zs]\d*)").unwrap(), // DUP
]
Expand Down

0 comments on commit cbe1667

Please sign in to comment.