Online PHP preg_match and preg_replace

Note: assumed character encoding is UTF-8. Uses appropriate PHP functions. JavaScript needed.

Input

Pattern:
Subject:
Data*:
Operation and
delimiter char:
Flags:i m s

Output