Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with regex for RTF tags

Status
Not open for further replies.

dragonwell

Programmer
Oct 21, 2002
863
US
Need to remove RTF tags. I found this PHP code in a forum and I'm trying to use the expressions:
Code:
$Abstracts = $fields->$Abstract;

//time to clean up those unwanted rtf codes

$matches = array('/(\{\\\)(.+?)(\})/','/(\\\)(.+?)(\b)/');

$CleanedAbstracts = preg_replace($matches,'',$Abstracts);

$CleanedAbstracts = str_replace('}','',$CleanedAbstracts);

$CleanedAbstracts = trim($CleanedAbstracts);

Apparently the preg_replace function can take an array of expressions to match. I figure I can just take both expressions and combine them with the | operator. What would that expression look like?

[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top