You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your answer. I also notice Russ Cox's statement in Golang-nuts
The lack of generalized assertions, like the lack of backreferences,
is not a statement on our part about regular expression style. It is
a consequence of not knowing how to implement them efficiently. If
you can implement them while preserving the guarantees made by the
current package regexp, namely that it makes a single scan over the
input and runs in O(n) time, then I would be happy to review and
approve that CL. However, I have pondered how to do this for five
years, off and on, and gotten nowhere.
tomj, dminGod, heyvito, garnix, dunstontc and 13 morelol768, jettero and Testzero-wz
Oh, fellas, it makes life so harder.
For example, (\w+)(\.\w+)+(?!.*(\w+)(\.\w+)+) to get a filename from URL does not work.
More or less workaround is [^\/?#]*\.[^\/?#]*(\?.*)?(\#.*)?$.
Activity
StefanSchroeder commentedon Apr 8, 2016
That is correct. This is not a bug. Refer to
https://github.com/google/re2/wiki/Syntax
to check the supported syntax.
thinkhy commentedon Apr 9, 2016
Thanks for your answer. I also notice Russ Cox's statement in Golang-nuts
sergeevabc commentedon Dec 25, 2016
Oh, fellas, it makes life so harder.
For example,
(\w+)(\.\w+)+(?!.*(\w+)(\.\w+)+)
to get a filename from URL does not work.More or less workaround is
[^\/?#]*\.[^\/?#]*(\?.*)?(\#.*)?$
.StefanSchroeder commentedon Jan 4, 2017
When retrieving a filename from a URL I would use 'split' at '/' and then take the last item. No need for regex.