Feature #11949

Allow @/$ prefix in Regexp's named captures

Added by repeatedly (Masahiro Nakagawa) about 5 years ago. Updated almost 5 years ago.

Target version:


fluentd hits the problem that Regexp's named captures doesn't allow @ prefix.

I assume this limitation is for auto variable assign feature.

In fluentd, there is no auto assign use case so we want to use @/$ prefix.
@ is used for Elastic related products and $ is used for MongoDB.
Currently, we need to add extra routine to convert foo to @foo / $foo after parsed the data.
It makes performance slower and causes complicated configuration.

I'm not sure the best approach but we want command line option or something to allow @/$ prefix in named captures.

Updated by matz (Yukihiro Matsumoto) almost 5 years ago

It should be fixed,I think,without assignment behavior.



Updated by naruse (Yui NARUSE) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset r53610.

  • regparse.c (fetch_name_with_level): allow non word characters
    at the first character. [Feature #11949]

  • regparse.c (fetch_name): ditto.

Updated by naruse (Yui NARUSE) almost 5 years ago

I committed to allow all characters (though previous phase rejects characters conflicting look behind (<! and <=)).

Anyway I notice original Oniguruma looks intended to allow only WORD.
I sent PR to Onigmo.

Also available in: Atom PDF