- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2018 12:09 PM
Hello There SN Gurus!
I have a variable that spans multiple lines and I am trying to find an easy way to create a variable from the data. Basically I want to see if there is a way to capture everything from ^" to "$ using regex.
Example:
LONGDESC="asdf
asdf
asdf
asdf
asdf"
Here is some sample code that I found, but it isn't doing what I want
Example:
desc = parseVar[i].split('LONGDESC=')[1].toString().replace(/^\"|^\"|\"$/g, '');
Thanks for the help and guidance!
Kindly,
Kelly
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 08:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 06:19 AM
I just tested this at rubular.com and was able to extract everything between the double quotes like this:
/^"(.*)"$/m
Your first group is going to contain the text, BUT you need to use the m modifier, not g.
You can find out more about RegEx in episodes 31 and 32 of TechNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 06:50 AM
Thanks Chuck!
That is good feedback and I appreciate the link to the regex tester. I tested the code on the inbound action and it still stops on a single line.
Any other ideas on what I can do to get the inbound action regex to match?
Kindly,
Kelly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 06:57 AM
Can you kindly share the inbound email action you've got right now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 07:14 AM
Hello There,
I think I found the issue. The code is parsing by newline
var parseVar = email.body_text.split('\n');
Is there a better way for me to parse the email? Loading the entire thing into an array and then working from there, but we get a lot of email to this inbound action and want to ensure we keep the performance up.
Sample Email (as text)
%LONGDESC="mail eater on
multiple lines"
Inbound Action to Find:
desc = parseVar[i].split('%LONGDESC=')[1].toString().replace(/^"(.*)"$/m, '');