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.: )"
Comments
Post a Comment