Skip to content

Commit

Permalink
Normalize regex patterns
Browse files Browse the repository at this point in the history
This closes #988
  • Loading branch information
tbw777 authored and michael-o committed Mar 8, 2023
1 parent 6f548e5 commit 11199cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface Artifact

String SNAPSHOT_VERSION = "SNAPSHOT";

Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}\\.[0-9]{6})-([0-9]+)$" );
Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-(\\d{8}\\.\\d{6})-(\\d+)$" );

// TODO into artifactScope handler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void testReadModifiedPoms() throws Exception {
// modify parent
File parent = new File( tempDir.toFile(), "pom.xml" );
String parentContent = FileUtils.fileRead( parent );
parentContent = parentContent.replaceAll( "<packaging>pom</packaging>",
parentContent = parentContent.replace( "<packaging>pom</packaging>",
"<packaging>pom</packaging><properties><addedProperty>addedValue</addedProperty></properties>" );
FileUtils.fileWrite( parent, "UTF-8", parentContent );
// re-build pom with modified parent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class JdkVersionProfileActivator
implements ProfileActivator
{

private static final Pattern FILTER_1 = Pattern.compile( "[^0-9._-]" );
private static final Pattern FILTER_1 = Pattern.compile( "[^\\d._-]" );
private static final Pattern FILTER_2 = Pattern.compile( "[._-]" );
private static final Pattern FILTER_3 = Pattern.compile( "\\." ); // used for split now

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DefaultModelValidator
implements ModelValidator
{

private static final Pattern CI_FRIENDLY_EXPRESSION = Pattern.compile( "\\$\\{(.+?)\\}" );
private static final Pattern CI_FRIENDLY_EXPRESSION = Pattern.compile( "\\$\\{(.+?)}" );

private static final String ILLEGAL_FS_CHARS = "\\/:\"<>|?*";

Expand Down

0 comments on commit 11199cf

Please sign in to comment.