Regex for Sentence Analysis in Permissions-based Sentence Structure
'/(?:i am|i\'m)\s+(not\s+)?allowed\s+to\s+(.+)$/i', '/(?:i am|i\'m)\s+(not\s+)?(supposed\s+to|able\s+to)\s+(.+)$/i', '/(dad|mom|parent|[a-z]+)\s+(says|said)?\s+(?:i\'m|i am|i|you are)\s+(not\s+|can\'t|cannot|allowed to)\s+(.+)$/i', '/(dad|mom|parent|[a-z]+)\s+(says|said)?\s+(?:i\'m|i am|i|you are)\s+(can|allowed to)\s+(.+)$/i', '/(?:i\s+)?(can\'t|cannot)\s+(.+)$/i' Makes total sense, right? Well, even I have a hard time with regex and I've been doing this for years. It definitely won't be able to understand everything, especially if the youth can't spell or uses short-form slang. Good luck trying to [...]