# Global replace for bbcode \[code\] with backticks

**URL:** <https://meta.discourse.org/t/global-replace-for-bbcode-code-with-backticks/111097>\
**Category:** Product Support\
**Created:** [March 8, 2019, 4:44pm UTC](https://meta.discourse.org/t/global-replace-for-bbcode-code-with-backticks/111097 "2019-03-08T16:44:44Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![eboehnisch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eboehnisch/32/133429_2.png) [@eboehnisch](https://meta.discourse.org/u/eboehnisch)\
**Post date:** [March 8, 2019, 4:44pm UTC](https://meta.discourse.org/t/global-replace-for-bbcode-code-with-backticks/111097/1 "2019-03-08T16:44:44Z")

</div>

Dear all,

I’ve just tried to run the many examples for a global find-and-replace here in this forum but struggled with two things:

1. How do I run these `rake posts: ...` commands? When I type the command at the command line I just end up with a new line showing a `>`. I’ve never done anything with Ruby so far.
2. How can I replace the string “[code]” with “```” followed by a newline?
3. Can I _search_ also for a newline so that only replace “[code]” that follows a newline?

Sorry for all these noob questions but I’m new to Discourse and in the midde of a large website relaunch 😕

Eric

---

_[View the full topic](https://meta.discourse.org/t/global-replace-for-bbcode-code-with-backticks/111097)._
