# Space out your stache

**URL:** https://forums.bitovi.com/t/space-out-your-stache/901
**Category:** CanJS
**Created:** [June 2, 2018, 12:12am UTC](https://forums.bitovi.com/t/space-out-your-stache/901 "2018-06-02T00:12:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)
#### Post date: [June 2, 2018, 12:12am UTC](https://forums.bitovi.com/t/space-out-your-stache/901/1 "2018-06-02T00:12:55Z")

</div>

These find/replace scripts:

`\{\{([^ #\/\^!])` -\> `{{ $1`  
`\{\{([#\/\^!])([^])` -\> `{{$1 $2`  
`([^])\}\}` -\> `$1 }}`

space out your stache to look more like:

```auto
{{# if(app.session) }}
	{{# if(app.session.isAdmin) }}
		<li {{# is(app.page, 'users') }}class='active'{{/ is }}>
			<a href="{{ routeUrl(page='users') }}">Users</a>
		</li>
	{{/ if }}
	<li {{# is(app.page, 'account') }}class='active'{{/ is }}>
		<a href="{{ routeUrl(page='account') }}">Account</a>
	</li>
	<li>
		<a href="javascript://" on:click="scope.vm.logout()">Logout</a>
	</li>
{{ else }}

```

If that’s what you are into

---

<div class="post-metadata">

### Author: ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)
#### Post date: [June 2, 2018, 12:15am UTC](https://forums.bitovi.com/t/space-out-your-stache/901/2 "2018-06-02T00:15:36Z")

</div>

This regexp can help you find helper expressions: `\{\{\s*([#\/\^])\s*\w+\s+[\w\.]+`

---

<div class="post-metadata">

### Author: ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)
#### Post date: [June 11, 2018, 6:47pm UTC](https://forums.bitovi.com/t/space-out-your-stache/901/4 "2018-06-11T18:47:10Z")

</div>

This regexp can find `{{#each(foo bar=value)}}`: `\{\{([#\/\^!])\s*each\(\s*[\w\.]+\s[\w\.]+`
