Regular expression string: PHPcode & lt; ahref & quot; teamMemberDisplay. php? TTeam & gt; SWDesignandISSScrumTeam2 & lt; a & gt; & lt; br & gt; & lt; ahref & quot; programDisplay. php? Pid positive expression
String:
PHP code
SW Design and ISS Scrum Team 2
LR RF & HW Modules->LR WCDMA CPRI Baseline->LR CPRI Misc.->SW Dev and Test
Calculate lr rf & HW Modules, lr wcdma cpri Baseline, lr cpri Misc ., SW Dev and Test, and retrieve only the regular expressions of lr rf & HW Modules.
The function I used in php is preg_match.
Thank you !!
------ Solution --------------------
PHP code
$ Str = <
Lr rf & HW Modules-> lr wcdma cpri Baseline-> lr cpri Misc. -> SW Dev and Test html; // echo $ str; quit (); preg_match_all ('/(? : \ S + |->)] *> (. *) <\/a>/isU ', $ str, $ arr); print_r ($ arr [1]);
------ Solution --------------------
$ Text = array ();
$ Html = "SW Design and ISS Scrum Team 2
Lr rf & HW Modules
Lr wcdma cpri Baseline
Lr cpri Misc.
SW Dev and Test ";
Preg_match_all ('| Program \/Domain \/BU \'> (. +) <\/a> | ', $ html, $ matches );
$ Text [0] = $ matches [1] [0];
Preg_match_all ('| Technical Domain \'> (. +) <\/a> | ', $ html, $ matches );
$ Text [1] = $ matches [1] [0];
Preg_match_all ('| Project \'> (. +) <\/a> | ', $ html, $ matches );
$ Text [2] = $ matches [1] [0];
Preg_match_all ('| title = \ 'Team \'> (. +) <\/a> | ', $ html, $ matches );
$ Text [3] = $ matches [1] [1];
Print_r ($ text );
------ Solution --------------------
(? : Expression) the non-capturing group matches the Expression of the subexpression and saves the matching content to the final configuration result of the entire Expression. However, the matching content of the Expression is not separately saved in the same group.
| Or