Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の文字 (アスタリスク) で始まる文字列の一部を照合したい:
abc*DEFxyz =>*DEF
abc*DEFxyz
*DEF
abc*DE*Fxyz=> *DE、*F
abc*DE*Fxyz
*DE
*F
試してみpreg_match_all('/[$\*A-Z]+/', $string, $matches);ましたが、うまくいかないようです。私*DE*Fは2番目の例に乗ります
preg_match_all('/[$\*A-Z]+/', $string, $matches);
*DE*F