Produced by Araxis Merge on 6/9/2017 3:49:57 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:49:57 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-common\src\main\java\gov\va\nvap\common\regex | RegExUtil.java | Fri Apr 21 20:03:26 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 60 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.nvap. common.reg ex; | |||||
| 2 | ||||||
| 3 | import jav a.util.Arr ayList; | |||||
| 4 | import jav a.util.Lis t; | |||||
| 5 | import jav a.util.reg ex.Matcher ; | |||||
| 6 | import jav a.util.reg ex.Pattern ; | |||||
| 7 | ||||||
| 8 | public cla ss RegExUt il { | |||||
| 9 | ||||||
| 10 | pu blic final static Pa ttern REPL ACE_BLANKS _PATTERN = Pattern.c ompile( | |||||
| 11 | "^[ \\ t]*$\\r?\\ n", Patter n.DOTALL | Pattern.M ULTILINE); | |||||
| 12 | ||||||
| 13 | pu blic final static Pa ttern REPL ACE_SPACES _PATTERN = Pattern.c ompile( | |||||
| 14 | "^[ \t ]+|[ \t]+$ ", Pattern .DOTALL | Pattern.MU LTILINE); | |||||
| 15 | ||||||
| 16 | pu blic stati c String g etFirstMat chValue(fi nal String text, | |||||
| 17 | final Pattern pa ttern) { | |||||
| 18 | ||||||
| 19 | if ( pattern == null) { | |||||
| 20 | return ""; | |||||
| 21 | } | |||||
| 22 | ||||||
| 23 | if ( (null == t ext) || (( text != nu ll) && (te xt.length( ) <= 0))) { | |||||
| 24 | return ""; | |||||
| 25 | } | |||||
| 26 | fina l Matcher matcher = pattern.ma tcher(text ); | |||||
| 27 | if ( matcher.fi nd()) { | |||||
| 28 | final String gro upText = m atcher.gro up(1); | |||||
| 29 | if ((g roupText ! = null) && (groupTex t.length() > 0)) { | |||||
| 30 | return g roupText.t rim(); | |||||
| 31 | } | |||||
| 32 | } | |||||
| 33 | retu rn ""; | |||||
| 34 | } | |||||
| 35 | ||||||
| 36 | pu blic stati c List<Str ing> getFi rstMatchVa lues(final String te xt, | |||||
| 37 | final Pattern pa ttern) { | |||||
| 38 | fina l List<Str ing> arrLi st = new A rrayList<S tring>(); | |||||
| 39 | ||||||
| 40 | if ( pattern == null) { | |||||
| 41 | return arrList; | |||||
| 42 | } | |||||
| 43 | ||||||
| 44 | if ( (null == t ext) || (( text != nu ll) && (te xt.length( ) <= 0))) { | |||||
| 45 | return arrList; | |||||
| 46 | } | |||||
| 47 | ||||||
| 48 | fina l Matcher matcher = pattern.ma tcher(text ); | |||||
| 49 | whil e (matcher .find()) { | |||||
| 50 | final String gro upText = m atcher.gro up(1); | |||||
| 51 | if ((g roupText ! = null) && (groupTex t.length() > 0)) { | |||||
| 52 | arrList. add(groupT ext.trim() ); | |||||
| 53 | } | |||||
| 54 | } | |||||
| 55 | retu rn arrList ; | |||||
| 56 | } | |||||
| 57 | ||||||
| 58 | pr otected Re gExUtil() { | |||||
| 59 | } | |||||
| 60 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.