I want to capture data from three fields in the email body as follows:
For the field "Area" limit the captured data to only the first 50 characters
For the field "Details" limit the captured data to only the first 200 characters
For the field "Cause" limit the captured data to only the first 200 characters
If the number of characters in the submitted text is less than the specified 50 or 200 the sparser should capture whaterver is submitted.
So if the input is :->
Regards
Shepherd
For the field "Area" limit the captured data to only the first 50 characters
For the field "Details" limit the captured data to only the first 200 characters
For the field "Cause" limit the captured data to only the first 200 characters
If the number of characters in the submitted text is less than the specified 50 or 200 the sparser should capture whaterver is submitted.
So if the input is :->
Area: harare london new york beijingI want the output to be:->
manchester madrid paris hong kong
singapore monaco pretoria cairo lagos lusaka
Details: Behind the curtain there is a world of calm,behind that thick green is sanctuary, profound hush.
An unsullied realm, its silence. From that flowing vision of another world,
from that other reality's diaspora of sounds; from that other time, enmeshed, they are calling me.
Cause: From the thick darkness of the middle ages man's
struggling spirit emerged as in new birth; breaking out of
the iron control of that period;
Area: harare london new york beijingI have problems when the input data comes in multiple lines as shown above. Because the number of lines is unpredictable I cannot implement " ... until end of line". I tried using regex but was not successful.
manchester madrid p
Details: Behind the curtain there is a world of calm,behind that thick green is sanctuary, profound hush.
An unsullied realm, its silence. From that flowing vision of another world,
from that other reality's d
Cause: From the thick darkness of the middle ages man's
struggling spirit emerged as in new birth; breaking out of the iron control of that period;
Regards
Shepherd
Hello Sheperd,
Try these regular expressions:
Area:(.|\r|\n){1,50}
Details:(.|\r|\n){1,200}
Cause:(.|\r|\n){1,200}
They were a bit tricky to write because using character number limit is not very common. I highly recomment an external tool to write complex regular expressions, they show all the available options you can add to your regular expression. My preferred one is Expresso:
http://www.ultrapico.com/expresso.htm
Try these regular expressions:
Area:(.|\r|\n){1,50}
Details:(.|\r|\n){1,200}
Cause:(.|\r|\n){1,200}
They were a bit tricky to write because using character number limit is not very common. I highly recomment an external tool to write complex regular expressions, they show all the available options you can add to your regular expression. My preferred one is Expresso:
http://www.ultrapico.com/expresso.htm