1

Can anyone suggest what is not compatible with salesforce in below

REGULAR EXPRESSION:

(?s)^\s*Contact received.*(?-s)(?<=Phone Number:)\s*(.*)

TEST STRING:

Contact received

E-mail Address: someone@email.com
Phone Number: 12345
Request:

A new contact

Thank you

I have created that regex to work in one of my email service api in salesforce, I'm trying to get phone number from that string in above example, same happened for email address

8
  • Is this regex via Apex? Regex via a formula? Can you explain a bit further exactly where you are using the regex. Also formatting above makes it difficult to tell which part is the beginning and end of the string. Thanks.
    – pchittum
    Aug 13 '15 at 9:27
  • I edited the question and formatting for better understanding
    – Dan
    Aug 13 '15 at 9:35
  • Thanks...I made a small edit to adjust formatting according to what you indicated. And just to be absolutely clear, you are using an inbound email service Apex class?
    – pchittum
    Aug 13 '15 at 9:43
  • yes @ inbound email service and thanks for help in formatting
    – Dan
    Aug 13 '15 at 9:45
  • 1
    What do you mean when you say it's "not compatible with Salesforce"? Are you getting errors when creating or saving the regex? Is it not matching the phone number? Is it matching anything at all?
    – Rob
    Aug 13 '15 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.