-2

Require you help in getting the below one.

Requirement :

We are getting data in file using , as a delimeter .

Example Data :

12345,aaaa,bbbb,ssc,aaa,99999999,xxx@gmail.com

So my problem is when we are using it in nxsd , can we validate the data that is coming in with some regular expression or something ( so that it takes only , delimiter records) apart from that when ever there will be another special character it should throw an error. Is it possible in nxsd.

Example1 of invalid data :

1|ddd|ggg|fff|ttt|777777777|ee@gmail.com

Example2 of invalid data :

12345,aaaa,bbbb,ssc,aaa,99999999,xxx@gmail.com 1|ddd|ggg|fff|ttt|777777777|ee@gmail.com

Please let me know how we can proceed further in this case.

Thanks & Regards, Vivek.

1 Answers1

0

the regex that would only give you valid strings would be:

^(?:[a-zA-Z0-9 ]+,)*[a-zA-Z0-9 ]+$

Then you could do a fn:tokenize in your transformation which would help this?

Let me know if this is the answer you need?

jtyreman
  • 256
  • 3
  • 15