|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Regular Expression syntax |
« View previous topic :: View next topic » |
Author |
Message
|
Mohit Gupta |
Posted: Thu Dec 09, 2004 2:24 am Post subject: Regular Expression syntax |
|
|
Apprentice
Joined: 16 Sep 2004 Posts: 34
|
Hi,
Can anybody tell me the regular expression syntax for the data mentioned below
V, RTS104220040712.235942, 24/11/2004 16:02:24
Cheers,
Mohit Gupta |
|
Back to top |
|
 |
kimbert |
Posted: Thu Dec 09, 2004 2:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You'll need to supply more information. I presume you want to match expressions like this one, rather than matching this exact string.
Is the leading 'V' fixed text, or can it be any character?
Is the first comma mandatory?
Does the second field always begin with 'RTS', or can it be any legal string value?
Will the second field always contain a period?
etc |
|
Back to top |
|
 |
Mohit Gupta |
Posted: Thu Dec 09, 2004 2:54 am Post subject: |
|
|
Apprentice
Joined: 16 Sep 2004 Posts: 34
|
Hi Kimbert,
Actually i have one complex type called FileHeader which has three elements RowType,Filename,Datetime
I have defined All Elements Delimited for Data Separation with Delimiter , for Element Reference FileHeader minOccurs 0 and maxOccurs 1
and on element FileHeader i am using Data Pattern
The whole purpose is if i receive the data in this way
1,5000,RT,2004,7,12/07/2004,11/07/2004,1311000AUD,1042,,AUD,510,510,,198.64,347123,TRF2679,1041: 1042,,,
then FileHeader shouldn't occur because its data pattern doesn't match
so i need the data pattern for this
V, RTS104220040712.235942, 24/11/2004 16:02:24
which i know is my file header
V is fixed , yes first comma mandatory, second field can be any legal string value not fixed and third field is of datetime in the above format |
|
Back to top |
|
 |
kimbert |
Posted: Thu Dec 09, 2004 5:36 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I have not tested this, so it may not work as posted, but it will look something like:
Code: |
V,.*,[0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} |
Since a time in this format cannot be greater than 59, you could get clever and change [0-9]{2} to [0-5][0-9] if you wanted to, but I would recommend that you leave the MRM's date/time conversion routines to check that kind of thing. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|