joeyboy156 Posted December 10, 2014 Share Posted December 10, 2014 Hello,One of my fields is returning a variety of different data. This is creating four lines of data when there should only be one. I cannot edit the data source to remove the unwanted values so I belive a simple print when expression will be my best bet. The following is the different data I recieve0000000ZZERRMN002 I would like to know how I would go about making a Print When Expression so only the last value is printed something along the lines of the following where L represents letter and N represents number$F{MyField} == 'LLNNN' All of the data I need from this field follows the pattern of Letter Letter Number Number NumberI have looked online but cannot find an answer, is anybody able to help out?Thanks Link to comment Share on other sites More sharing options...
Solution james.t Posted December 11, 2014 Solution Share Posted December 11, 2014 You can use Java regular expressions: $F{MyField}.matches("[a-zA-Z][a-zA-Z]\d\d\d") Link to comment Share on other sites More sharing options...
joeyboy156 Posted December 11, 2014 Author Share Posted December 11, 2014 Thanks, this worked perfectly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now