{"content":{"id":927,"title":"'Build Your Own Lisp' Solutions: 6.2","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e Write a regular expression matching strings of consecutive a and b such as ababab or aba.\u003c/p\u003e\r\n\u003cbr\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e/(ab)/\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2019-10-09T00:00:00.000Z","created_at":"2019-09-08T19:17:57.000Z","updated_at":"2019-09-08T19:17:57.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.2

Q: Write a regular expression matching strings of consecutive a and b such as ababab or aba.


A:

/(ab)/