Answer the question
In order to leave comments, you need to log in
How to get individual elements of a string with a regular expression?
I get a regular expression from html and get a set of lines like
/reports/schedule/Group/14779_1_26102020_08112020.pdf
groupRegexp := regexp.MustCompile("/reports/schedule/Group/[0-9]{4,}_[1|2]_[0-9]{8}_[0-9]{8}.pdf")
doc := GetHtml(config.C.GroupPage) // Получение html кода страницы
datesGroup := groupRegexp.FindAllString(doc, -1)
for _, val := range datesGroup {
fmt.Println(val) // вывод найденных элементов
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question