{"content":{"id":982,"title":"'Build Your Own Lisp' Solutions: 6.3","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e Write a regular expression matching pit, pot and respite but not peat, spit, or part.\u003c/p\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e# This works, but is a weird answer to a weird exercise.\r\n/(^|res)p[io]/\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2019-11-13T00:00:00.000Z","created_at":"2019-10-16T01:07:00.000Z","updated_at":"2020-07-13T00:22:16.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=lisp\"\u003elisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=build_your_own_lisp\"\u003ebuild_your_own_lisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=answers\"\u003eanswers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

'Build Your Own Lisp' Solutions: 6.3

Q: Write a regular expression matching pit, pot and respite but not peat, spit, or part.

A:

# This works, but is a weird answer to a weird exercise.
/(^|res)p[io]/