Github user ijokarumawak commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2947#discussion_r222506249
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
 ---
    @@ -70,9 +71,8 @@
      */
     public class FileSystemSwapManager implements FlowFileSwapManager {
     
    -    public static final int MINIMUM_SWAP_COUNT = 10000;
    -    private static final Pattern SWAP_FILE_PATTERN = 
Pattern.compile("\\d+-.+\\.swap");
    -    private static final Pattern TEMP_SWAP_FILE_PATTERN = 
Pattern.compile("\\d+-.+\\.swap\\.part");
    +    private static final Pattern SWAP_FILE_PATTERN = 
Pattern.compile("\\d+-.+(\\..*?)?\\.swap");
    +    private static final Pattern TEMP_SWAP_FILE_PATTERN = 
Pattern.compile("\\d+-.+(\\..*?)?\\.swap\\.part");
    --- End diff --
    
    The extra ? after '+' is needed if the bracket is meant to capture the 
optional partition_name part. Anyway, it's not critical since the regex can 
match with expected strings..
    
    Using regex101.com, we can see the difference:
    https://regex101.com/
    
    
![image](https://user-images.githubusercontent.com/1107620/46446278-56db7b80-c7b6-11e8-877d-fa653395e68b.png)
    
    
![image](https://user-images.githubusercontent.com/1107620/46446268-4cb97d00-c7b6-11e8-86e2-816b68e01fde.png)



---

Reply via email to