Skip to content

Commit

Permalink
explain regex
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrego committed Jan 30, 2024
1 parent ee6e594 commit 75db44f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public class HmmerModelParser extends AbstractModelFileParser {
/**
* Matches the name line.
* Group 1: Model name.
*
* NOTE: SFLD NAMEs may have '\$\d+' at end of string and this will be stripped off.
* This numbers are used to guarantee unique names.
*/
// private static final Pattern NAME_LINE = Pattern.compile("^NAME\\s+(.+)$");

private static final Pattern NAME_LINE = Pattern.compile("^NAME\\s+(.*?)(?:\\$\\d+)?$");

// private static final Pattern NAME_LINE_SFLD = Pattern.compile("^NAME\\s+(.*?)(?:\\[\\d+\\])?$");

/**
* Matches the Description line.
* Group 1: Description.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class SuperFamilyModelParser extends AbstractModelFileParser {
private static final Pattern DESC_LINE = Pattern.compile("^DESC\\s+(.+)$");

/**
* Matches the signature accession line (but needs "SSF" prefix adding) and if there is a version number it will be
* stripped off (but doesn't really apply here).
* Matches the signature accession line (but needs "SSF" prefix adding) and if there is a 'version' number it will be
* stripped off. 'version' numbers are used to guarantee unique SuperFamily ACCs.
*/
private static final Pattern ACCESSION_PATTERN = Pattern.compile("^ACC\\s+([A-Z0-9]+)\\.?.*$");

Expand Down

0 comments on commit 75db44f

Please sign in to comment.