how to implement complex pattern matching in Spring batch using PatternMatchingCompositeLineMapper

空扰寡人 提交于 2019-12-02 08:37:09

The PatternMatchingCompositeLineMapper uses an instance of org.springframework.batch.support.PatternMatcher to do the matching. It's important to note that PatternMatcher does not use true regular expressions. It uses something closer to ant patterns (the code is actually lifted from AntPathMatcher in Spring Core).

That being said, you have three options:

  1. Use a pattern like you are referring to (since there is no short hand way to specify the number of ? that should be checked like there is in regular expressions).
  2. Create your own composite LineMapper implementation that uses regular expressions to do the mapping.

For the record, if you choose option 2, contributing it back would be appreciated!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!