zathura-pdf-poppler | PDF support for zathura | Document Editor library
kandi X-RAY | zathura-pdf-poppler Summary
kandi X-RAY | zathura-pdf-poppler Summary
PDF support for zathura (poppler)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of zathura-pdf-poppler
zathura-pdf-poppler Key Features
zathura-pdf-poppler Examples and Code Snippets
Community Discussions
Trending Discussions on zathura-pdf-poppler
QUESTION
Can someone explain, how this sed command works here?
...ANSWER
Answered 2018-Dec-31 at 05:36In your regex ([^.]*\).*
, (
which actually is \(
is the start of a capturing group and then [^.]*
captures every character except a literal dot and *
means zero or more, then \)
is the mark of closing of group that we started, then .*
captures whatever remains after capturing group1.
Similar will be the explanation for \(.*\)-.*
regex, where \(.*\)
will capture everything greedily in capturing group but will stop at last hyphen -
and then will match hyphen and further .*
will match remaining text.
To explain with an example, lets take youtube_dl-2018.12.03
.
Here, \([^.]*\)
will capture everything until dot, hence it will capture youtube_dl-2018
and then remaining .*
will capture .12.03
. Then it will be replaced by \1
which means youtube_dl-2018
will be passed to the next regex -e 's/\(.*\)-.*/\1/'
.
Then in your second regex, \(.*\)-.*
, \(.*\)
will capture youtube_dl
and put in group1 because after that there is a hyphen and .*
will capture remaining text which is 2018
. And as it is replaced by \1
hence final text will become youtube_dl
.
Seeing your data, I believe, you can also simplify your command to this, as your first regex in sed
command seems redundant. Try this following command and see if it outputs same result?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install zathura-pdf-poppler
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page