Shani Ranasinghe
January 31, 2020 04:08AM
Hi,
I would like to know if njs supports regex positive look behinds.
I have written a script in perl and would like to convert it to njs. The
reg ex I have in perl is
"((?<=[a-z])(?=[A-Z])(?!ID)(?!^Open$)|(?<=ABC)|(?<=API)(?=[A-Z])|(?=Connect))"
This would give the following outputs.

*Inputs and expected outputs* are *listed below* in the format *Input ->
Expected Output*

1.

InstallAndSetup -> install-and-setup
2.

DeployingABCDefGhijk -> deploying-abc-def-ghijk (assuming abc is a noun
that is frequently used)
3. OpenIDConnect -> openid-connect
4. OAuth2Scopes->oauth2-scopes
5. APISecurity -> api-security

I would like to know if there's a way to achieve this with njs?

Thank you in advance.
Regards,
Shani.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Does NJS support reg ex positive look behinds?

Shani Ranasinghe 436 January 31, 2020 04:08AM

Re: Does NJS support reg ex positive look behinds?

Dmitry Volyntsev 184 January 31, 2020 08:04AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready