I have some requirement which should validate the string. My requirement is:
1. if the given string length is less than 5, throw an error.
2. if the string is longer than 5, then break the string into substrings of length of 6. Test the Substring.
-> the substring last value should end with ; or |. i.e., 6th character.
-> if the value at position 0 or 4 are a whitespace throw an error.
-> if the value at position 0 thru 4 is something other than alphanumeric character or whitespace or '@' symbol, throw an error.
if there are more substring, repeat the process.
How to obtain this.
sample xml file is:
Code:
<sample>
<row>
<comment>
<value>ABCDE</value>
</comment>
</row>
<row>
<comment>
<value>ABCDE;ABCDE</value>
</comment>
</row>
</sample>
if u need more info, kindly let me know.