hankknight
asked on
PHP/REGEX: everything before certain characters
Using PHP and REGEX, I would like only everything before certain characters.
Everything after any of the following characters, including those characters, should be removed.
:
!
0
1
2
3
4
5
6
7
8
9
(
For example, this:
Hello World! This is a test.
Should become this:
Hello World
This:
Hi 123
Should become this:
Hi
Everything after any of the following characters, including those characters, should be removed.
:
!
0
1
2
3
4
5
6
7
8
9
(
For example, this:
Hello World! This is a test.
Should become this:
Hello World
This:
Hi 123
Should become this:
Hi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window