Answer the question
In order to leave comments, you need to log in
How to block domains in linux?
How (in the easiest way) to block access to sites with obscene content?
PS I know about iptables, but maybe there is an option without manually knocking out url-s?
Answer the question
In order to leave comments, you need to log in
Specifically for this line, you can do this:
$str = '~astbbhf_sg_fasgs~3.6.0=SOME_OTHER_STRING.~phase2~3.6.0=OLD';
preg_match('/someflag.*=(.+?)\./i', $str, $m);
$result = $m[1];
$result
will be equal tonull
^(~[A-Za-z]+_(someflag.*?=(.+?)\.~.*|.*)|.*)
for example, the command for bash using perl is:
echo '~astring_someflag_xds~2.37.0=NEEDED_STRING_TO_EXTRACT.~cha_khe_mil~2.22.0=TADA' \
| perl -pe 's/^(~[a-z]+_(someflag.*?=(.+?)\.~.*|.*)|.*)/\3/i'
$_='~astring_someflag_xds~2.37.0=NEEDED_STRING_TO_EXTRACT.~cha_khe_mil~2.22.0=TADA';
s/^(~[a-z]+_(someflag.*?=(.+?)\.~.*|.*)|.*)/\3/i;
print;
$str = '~astring_someflag_xds~2.37.0=NEEDED_STRING_TO_EXTRACT.~cha_khe_mil~2.22.0=TADA';
preg_match('s/^(~[a-z]+_(someflag.*?=(.+?)\.~.*|.*)|.*)/i', $str, $m);
print($m[3]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question