I've a code like that in golang
func GetIndexes(body string) ([]int, error) {
indexPattern, err := regexp.Compile(`<div class="post article" id="([0-9]+)">`)
res := indexPattern.FindAllStringSubmatch(body, -1)
fmt.Printf("%v
", res)
//Just for debug
return make([]int, 5), err
}
for exemple the result is like :
[
[<div class="post article" id="55987"> 55987]
[<div class="post article" id="6717024"> 6717024]
[<div class="post article" id="6440542"> 6440542]
[<div class="post article" id="6800745"> 6800745]
[<div class="post article" id="449954"> 449954]
[<div class="post article" id="427586"> 427586]
[<div class="post article" id="5418445"> 5418445]
[<div class="post article" id="559225"> 559225]
...
]
And I'm looking for a way to get just an array like
[55987, 6717024, 6717024, ...]
I could range the array and copy value which I looking for, but i'm not sure it's the better way. It's why I ask myself if it's possible to drop column of this array, or why not create kind of slices with lambdas functions or other...
Thank you