Skip to content

Multiline Regex #1694

Answered by BurntSushi
BiBi-Abc asked this question in General
Oct 1, 2020 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

ripgrep does read the entire file, so I think I would have to scrutinize how you are measuring that it's only using 8MB of memory. On my Linux system, my time command is configured to tell me peak memory usage. Here are a few different variations of your command:

$ time rg -U "Sherlock\nA" OpenSubtitles2018.raw.en
37584157:You go for it, Sherlock
37584158:Arthur?
145584942:You go for it, Sherlock
145584943:Arthur?
145585729:You go for it, Sherlock
145585730:Arthur?

real    3.118
user    2.657
sys     0.456
maxmem  12508 MB
faults  0

$ time rg -U "Sherlock\nA" OpenSubtitles2018.raw.en --no-mmap
37584157:You go for it, Sherlock
37584158:Arthur?
145584942:You go for it, Sherlock
145584943:…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BiBi-Abc
Comment options

@BurntSushi
Comment options

@BiBi-Abc
Comment options

Answer selected by BiBi-Abc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants