I need to extract the profile for these syslog entries.
May 11 09:35:59 server-0548 ea_appserver: env=ACPT profile=product_api java[31185]: 2017-05-
POSIX ERE does not support inline regex modifiers, and shorthand character classes are not always supported. Note that even in your (?m)profile=(\S+) PCRE regex, the (?m) MULTILINE modifier is redudant as there is no ^, nor $ to redfine the behavior of. What you may use is a POSIX character class [:space:] (matching any whitespace) inside a negated bracket expression:
profile=([^[:space:]]+)
Details:
profile= - a literal substring([^[:space:]]+) - Group 1: one or more characters other than those that can be matched with [:space:] POSIX character class.