troubleshooting Question

Regex for String

Avatar of EMB01
EMB01Flag for United States of America asked on
PHPRegular Expressions
3 Comments2 Solutions304 ViewsLast Modified:
In the following string I would like to get the following:

Get this:

Business Machine.\nCombustion.\nFuel Cell.\nIndustrial.\nMedical.\nTransit.\nAquaculture.\nOther.

From this:

string(264) "required=0 changeable=0 show_at_reg_form=0 show_at_my_details_form=0 show_at_userlist_profile=0 show_at_userlist_card=0 values=Business Machine.\nCombustion.\nFuel Cell.\nIndustrial.\nMedical.\nTransit.\nAquaculture.\nOther. default_values= searcheable=1 cols=20 " 
$subject = "abcdef";
$pattern = '/^def/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
Thank you.
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros