php - Replace text grabbed from Wikipedia -


i grab text wikipedia , there's tricky part. in articles there this(ignore bad formatting):

 (pron.: /ˌhjuˠˈlɒri/) 

i need gone; there might useful data in way:

(pron.: /ˈliːsə ˈɛdəlstiːn/; born may 21, 1966) 

i have noticed ends "/" or "/;" , starts pron.:

i have tried , tried, miserably failed. there regex master me out there?

(per request) best working replace parentheses s = s.replace(/(.*?)/, ' ');

try this

$str = "(pron.: /ˌhjuˠˈlɒri/)";     $a = preg_replace('#\/(.*?)\/#','',$str);         var_dump($a);  

and after if want remove pron.:, use str_replace.

output

string(9) "(pron.: )" 

codepad


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -