Reputation: 31487
I've already got help here for creating a quotation extraction function. Thanks alot, soulmerge!
Now I'm looking for regular expressions (PHP) which extract the cited text and the cited person. The person should be in one index (substring), the text in another index (substring).
For English texts, soulmerge proposed these regexes:
/"(.*?)[,.]?\h*"\h*said\h*(.*?)\./
/"(.*?)\h*"(.*)said/
/\.\h*(.*)(once)?\h*said[\-]*"(.*?)"/
I would like to "translate" the following direct speech examples in German to regexes:
Can someone help me to build the adequate regular expressions for these direct speech forms?
I hope you can help me. Thank you very much in advance!
Upvotes: 1
Views: 199
Reputation: 35971
Please note that the person and question variables are reversed in the second regex.
Upvotes: 1