Похожие чаты

Hey, does somebody know, can regexp fail only because of

the big length of input string (my string is a little bigger than 800k symbols)?
str := "somestring \"text\":[`somestring`,] somestring"
reg := regexp.MustCompile("\"text\":\\[`(.*?)`,\\]")
match := reg.FindStringSubmatch(sbody)
fmt.Println(match[1])
This example works correctly, but when I change str with real string with 800k symbols, i have this error
goroutine 1 [running]:
main.main()
Path/to/directory/main.go:24 +0x19f

Process finished with the exit code 2
If i am wrong, what can be cause of this error?

4 ответов

31 просмотр
boost::regex- Автор вопроса

If in this example, with one actual match, this work correctly, why it fail with the big string? So, answer to your question, is more no, than yes I may be wrong

boost::regex
If in this example, with one actual match, this wo...

Instead of printing a single element (match[1]), try printing the whole thing fmt.Printf("%v\n", match ). match could be empty or have only 1 element.

boost::regex- Автор вопроса
eme
Instead of printing a single element (match[1]), t...

Okay this is worst than phantom error. I do some debug, and there really nil in match. I write wrong regex, and I don't know why

boost::regex
Okay this is worst than phantom error. I do some d...

Lesson learned to never just use a slice without length checking it first :P

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта