Create an Apache SetEnv variable with the value of a subclaimDifference between the Apache HTTP Server and Apache Tomcat?How to enable mod_rewrite for Apache 2.2How to use the setEnv variable in apache?Apache SetEnv not working as expected with mod_wsgiConditionally set environment variable in Apache configAllow from env with mod_rewrite not mod_setenvif in .htaccessPass REQUEST_URI from Apache to TomcatApache ACL based on environment variable valueEnvironment variable not being found in Apache config

Why keep the bed heated after initial layer(s) with PLA (or PETG)?

What was the rationale behind 36 bit computer architectures?

Strange Cron Job takes up 100% of CPU Ubuntu 18 LTS Server

The seven story archetypes. Are they truly all of them?

How can I prevent corporations from growing their own workforce?

What is the meaning of "you has the wind of me"?

Can two figures have the same area, perimeter, and same number of segments have different shape?

Closet Wall, is it Load Bearing?

How were the LM astronauts supported during the moon landing and ascent? What were the max G's on them during these phases?

Why do people say "I am broke" instead of "I am broken"?

Spacing setting of math mode

Is the apartment I want to rent a scam?

Why did Saturn V not head straight to the moon?

Spoken encryption

What should I say when a company asks you why someone (a friend) who was fired left?

Can GPL and BSD licensed applications be used for government work?

What do teaching faculty do during semester breaks?

Is an easily guessed plot twist a good plot twist?

USA: Can a witness take the 5th to avoid perjury?

How can I receive packages while in France?

What is the difference between $path and $PATH (lowercase versus uppercase) with zsh?

Why are off grid solar setups only 12, 24, 48 VDC?

kids pooling money for Lego League and taxes

How do I run a game when my PCs have different approaches to combat?



Create an Apache SetEnv variable with the value of a subclaim


Difference between the Apache HTTP Server and Apache Tomcat?How to enable mod_rewrite for Apache 2.2How to use the setEnv variable in apache?Apache SetEnv not working as expected with mod_wsgiConditionally set environment variable in Apache configAllow from env with mod_rewrite not mod_setenvif in .htaccessPass REQUEST_URI from Apache to TomcatApache ACL based on environment variable valueEnvironment variable not being found in Apache config






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have an environment variable called FIRST and containing a JSON :




"claim1": "val1",
"claim2": "val2"



I would like to set a new environment variable which should contain only val1.



I tried to set this new variable (SECOND) using SetEnvIf but unfortunately this doesn't work:



SetEnvIf FIRST ("claim1":)(.*?)"(.*?)" SECOND=$3


The regex is correct, you can check it here : demo



The FIRST variable is not a request attribute even if it seems to be required according to the Apache Module mod_setenvif documentation..



Any idea how I could achieve this ?



Thanks !










share|improve this question
























  • try changing to SECOND=$1

    – Matt.G
    Mar 26 at 16:08












  • I tried this but it's still not working for me. The SECOND variable is empty.

    – MaryC
    Mar 26 at 16:39











  • regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

    – Matt.G
    Mar 26 at 16:43












  • A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

    – Matt.G
    Mar 26 at 16:48











  • Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

    – MaryC
    Mar 26 at 17:23


















1















I have an environment variable called FIRST and containing a JSON :




"claim1": "val1",
"claim2": "val2"



I would like to set a new environment variable which should contain only val1.



I tried to set this new variable (SECOND) using SetEnvIf but unfortunately this doesn't work:



SetEnvIf FIRST ("claim1":)(.*?)"(.*?)" SECOND=$3


The regex is correct, you can check it here : demo



The FIRST variable is not a request attribute even if it seems to be required according to the Apache Module mod_setenvif documentation..



Any idea how I could achieve this ?



Thanks !










share|improve this question
























  • try changing to SECOND=$1

    – Matt.G
    Mar 26 at 16:08












  • I tried this but it's still not working for me. The SECOND variable is empty.

    – MaryC
    Mar 26 at 16:39











  • regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

    – Matt.G
    Mar 26 at 16:43












  • A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

    – Matt.G
    Mar 26 at 16:48











  • Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

    – MaryC
    Mar 26 at 17:23














1












1








1








I have an environment variable called FIRST and containing a JSON :




"claim1": "val1",
"claim2": "val2"



I would like to set a new environment variable which should contain only val1.



I tried to set this new variable (SECOND) using SetEnvIf but unfortunately this doesn't work:



SetEnvIf FIRST ("claim1":)(.*?)"(.*?)" SECOND=$3


The regex is correct, you can check it here : demo



The FIRST variable is not a request attribute even if it seems to be required according to the Apache Module mod_setenvif documentation..



Any idea how I could achieve this ?



Thanks !










share|improve this question
















I have an environment variable called FIRST and containing a JSON :




"claim1": "val1",
"claim2": "val2"



I would like to set a new environment variable which should contain only val1.



I tried to set this new variable (SECOND) using SetEnvIf but unfortunately this doesn't work:



SetEnvIf FIRST ("claim1":)(.*?)"(.*?)" SECOND=$3


The regex is correct, you can check it here : demo



The FIRST variable is not a request attribute even if it seems to be required according to the Apache Module mod_setenvif documentation..



Any idea how I could achieve this ?



Thanks !







apache setenv setenvif






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 10:31







MaryC

















asked Mar 26 at 16:03









MaryCMaryC

62 bronze badges




62 bronze badges












  • try changing to SECOND=$1

    – Matt.G
    Mar 26 at 16:08












  • I tried this but it's still not working for me. The SECOND variable is empty.

    – MaryC
    Mar 26 at 16:39











  • regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

    – Matt.G
    Mar 26 at 16:43












  • A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

    – Matt.G
    Mar 26 at 16:48











  • Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

    – MaryC
    Mar 26 at 17:23


















  • try changing to SECOND=$1

    – Matt.G
    Mar 26 at 16:08












  • I tried this but it's still not working for me. The SECOND variable is empty.

    – MaryC
    Mar 26 at 16:39











  • regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

    – Matt.G
    Mar 26 at 16:43












  • A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

    – Matt.G
    Mar 26 at 16:48











  • Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

    – MaryC
    Mar 26 at 17:23

















try changing to SECOND=$1

– Matt.G
Mar 26 at 16:08






try changing to SECOND=$1

– Matt.G
Mar 26 at 16:08














I tried this but it's still not working for me. The SECOND variable is empty.

– MaryC
Mar 26 at 16:39





I tried this but it's still not working for me. The SECOND variable is empty.

– MaryC
Mar 26 at 16:39













regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

– Matt.G
Mar 26 at 16:43






regex is missing a space after the :. try (?:"claim1": ")(.*?)(?:") .Demo

– Matt.G
Mar 26 at 16:43














A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

– Matt.G
Mar 26 at 16:48





A better regex would be (?:"claim1" *: *")([^"]+) Demo . This should handle spaces.

– Matt.G
Mar 26 at 16:48













Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

– MaryC
Mar 26 at 17:23






Apache seems to refuse the Regex (even if it is correct according to the link below). I have the following error message '"SetEnvIf Regex could not be compiled"

– MaryC
Mar 26 at 17:23













0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361510%2fcreate-an-apache-setenv-variable-with-the-value-of-a-subclaim%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361510%2fcreate-an-apache-setenv-variable-with-the-value-of-a-subclaim%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript