package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^(.*?)\bdefault\b`)
var str = `../app/code/community/Company/Module/Block/Adminhtml/Location/Grid.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Import.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Edit/Form.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Edit/Import.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Edit/Tabs.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Edit/Tab/Form.php
../app/code/community/Company/Module/Block/Adminhtml/Location/Edit/Tab/Import.php
../app/code/community/Company/Module/controllers/IndexController.php
../app/code/community/Company/Module/controllers/LocationController.php
../app/design/adminhtml/default/default/layout/pmodule.xml
../app/design/frontend/default/default/layout/pmodule.xml
../app/design/frontend/default/default/template/company/module/gmap.phtml`
var substitution = "\1rwd"
fmt.Println(re.ReplaceAllString(str, substitution))
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/