Does NJS support reg ex positive look behinds?

Shani Ranasinghe shanira14 at gmail.com
Fri Jan 31 09:06:54 UTC 2020


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20200131/e4ae0c8d/attachment.htm>


More information about the nginx-devel mailing list