RuleMaker
April 12th, 2009, 06:44 PM
I have have the following string:
OAS_query = 'context=trvl_btrav_36hr&pdsrch=300x170&temp=72&uv=1&humid=34&dew=42&wind=16&cond=clear_sunny&templ1=49&temph2=67&templ2=47&temph3=66&templ3=46&';
rsi=rsi_clean_array.join('&rsi=');function filterNum(str){var temp=str;temp=temp.replace(/[^a-zA-Z 0-9]+/g,'_');temp=temp.replace(/\s/g,'_');temp=temp.toLowerCase();return temp;}
...and I need to extract only the "72" that follows the "temp=".
I thought using sed would be the best solution but I cant manage to do this.
I'm new to bash scripting although I often use regular expressions with JavaScript.
OAS_query = 'context=trvl_btrav_36hr&pdsrch=300x170&temp=72&uv=1&humid=34&dew=42&wind=16&cond=clear_sunny&templ1=49&temph2=67&templ2=47&temph3=66&templ3=46&';
rsi=rsi_clean_array.join('&rsi=');function filterNum(str){var temp=str;temp=temp.replace(/[^a-zA-Z 0-9]+/g,'_');temp=temp.replace(/\s/g,'_');temp=temp.toLowerCase();return temp;}
...and I need to extract only the "72" that follows the "temp=".
I thought using sed would be the best solution but I cant manage to do this.
I'm new to bash scripting although I often use regular expressions with JavaScript.