It all depends on what do you exactly mean with "all characters"... it could include or not character sets such as whitespace (optionally including newlines), letters, numbers, symbols, unicode sets, etc.
So...
If you really meant "all characters" (i.e. including whitespace) between the first "a" and "ccc" you need to use:
a.+ccc
If you meant just all "word characters" you can use one of these:
a\w+ccc
a[0-9a-zA-Z_]+ccc
All letters:
a[a-zA-Z]+ccc
All lowcase letters:
a[a-z]+ccc
...and there will be more options depending on your real requirements for that definition.
Here you have a small program to test some of that cases:
package main
import "fmt"
import "regexp"
func main() {
res := []string{
`a.+ccc`,
`a\w+ccc`,
`a[a-z]+ccc`,
}
ss := []string{
"ablablacccc",
"adadasdccc",
"sadlkasdlkcccc",
"accc",
"blaafoewoiccc",
"oirorwccc",
"abla ablaccc",
}
for _, re := range res {
r := regexp.MustCompile(re)
fmt.Printf("regular expression: %q\n", re)
for _, s := range ss {
fmt.Printf(" case %q: matches=%v match=%q\n", s, r.MatchString(s), r.FindString(s))
}
}
}
And the output it produces:
regular expression: "a.+ccc"
case "ablablacccc": matches=true match="ablablacccc"
case "adadasdccc": matches=true match="adadasdccc"
case "sadlkasdlkcccc": matches=true match="adlkasdlkcccc"
case "accc": matches=false match=""
case "blaafoewoiccc": matches=true match="aafoewoiccc"
case "oirorwccc": matches=false match=""
case "abla ablaccc": matches=true match="abla ablaccc"
regular expression: "a\\w+ccc"
case "ablablacccc": matches=true match="ablablacccc"
case "adadasdccc": matches=true match="adadasdccc"
case "sadlkasdlkcccc": matches=true match="adlkasdlkcccc"
case "accc": matches=false match=""
case "blaafoewoiccc": matches=true match="aafoewoiccc"
case "oirorwccc": matches=false match=""
case "abla ablaccc": matches=true match="ablaccc"
regular expression: "a[a-z]+ccc"
case "ablablacccc": matches=true match="ablablacccc"
case "adadasdccc": matches=true match="adadasdccc"
case "sadlkasdlkcccc": matches=true match="adlkasdlkcccc"
case "accc": matches=false match=""
case "blaafoewoiccc": matches=true match="aafoewoiccc"
case "oirorwccc": matches=false match=""
case "abla ablaccc": matches=true match="ablaccc"