Nura111
asked on
Php, Regex question
Hi im trying to find all common wors and replace them
im doing that as followed:
$commonWords = array('is','that','them',' and','he', 'the','\-' );
$text=strtolower($text);
$text = preg_replace('/\b('.implod e('|',$com monWords). ')\b/','', $text);
I have a probel with finding the "-" sign and "--" and so on i did read on REGEX but it doesnt seem that those signs are a special chars.
Thanks
im doing that as followed:
$commonWords = array('is','that','them','
$text=strtolower($text);
$text = preg_replace('/\b('.implod
I have a probel with finding the "-" sign and "--" and so on i did read on REGEX but it doesnt seem that those signs are a special chars.
Thanks
ASKER
well I tried at the beginning to write it like that and its didnt work l it was still there at the output
ASKER
anyone?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
on http://www.gskinner.com/RegExr/ is there a way to insert a pattern to check it? I dont seem to find it. Thank you beacuse it doesnt seem to work at my code. does it the same for 2 hay-fens (--)
ASKER
?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!!
ASKER
where can you see the results if you replaced it?
$commonWords = array('is','that','them','