Could someone please explain this REGEX?

Posted by NJTechGuy on Stack Overflow See other posts from Stack Overflow or by NJTechGuy
Published on 2010-03-16T22:02:23Z Indexed on 2010/03/16 22:11 UTC
Read the original article Hit count: 312

Filed under:
|
|
if($title =~ s/(\s|^|,|\/|;|\|)$replace(\s|$|,|\/|;|\|)//ig)

$title can be a set of titles ranging from President, MD, COO, CEO,...

$replace can be (shareholder), (Owner) or the like.

I keep getting this error. I have checked for improperly balanced '(', ')', no dice :(

Unmatched ) in regex; marked by <-- HERE in m/(\s|^|,|/|;|\|)Owner) <-- HERE (\s|$|,|/|;|\|)/

If you could tell me what the regex does, that had be awesome. It strips those symbols is it? Sorry long day at work. Thanks guys!

© Stack Overflow or respective owner

Related posts about regex

Related posts about perl