I have a string that I run a regex against it but I get an error.
PHP:
<?php
$str = 'modified: apps/aaaaaa/bbbbbb/cccc
modified: apps/ami (new commits)
modified: apps/assess (new commits)
modified: apps/ees121 (new commits)
modified: apps/energy_bourse (new commits)
modified: apps/gis (new commits)
modified: apps/hse (new commits)
modified: apps/aa/aaa/a/bb/b/bb/bc/c22/s/df/s/
modified: apps/management (new commits)
modified: apps/payesh (new commits)
modified: external_apps (modified content)
modified: modules/esb_server (new commits)
modified: modules/formbuilder (new commits, modified content)
modified: modules/reporting (new commits)
modified: modules/safir (new commits)
modified: modules/workflow (new commits)
modified: vendor/raya_framework/client (new commits)
modified: vendor/raya_framework/core (new commits)';
preg_match_all("/modified:\s+((\w+\/?)+).*\)/", $str, $matches);
var_dump($matches);
This works fine but if I append a few characters to one of the lines, nothing's matched. E.g.:
modified: apps/aaaaaa/bbbbbb/ccccfff
This seems to depend on word characters and not forward slashes. Why do some characters make a difference here? and what can I do?