Hi guys,
does anyone know how to test for a regular expression - i want to include it in a script to make sure the variable is a regexp
cheers (1 Reply)
What is the easiest way to get full address of *.jpg images from html file using perl?
example:
http://farm3.static.flickr.com/2397/2126443111_65a810004c.jpg (1 Reply)
I'd like to know if there is a catchall line for renaming the following patterns:
s01e03 -> 01x03
s4e9 -> 04x09
s10e08 ->10x08
and possibly even:
318 -> 03x18
1002 ->10x02
if its the first 3 or first digit number in the string.
thanks! (0 Replies)
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
I don't want to have to resort to
/()/
though that does work.
Effectively, I need to be able to implement
/(?:(?:regexp1){0})(regexp2)\D/
to basically match regexp2 as long as it is present and regexp1 is NOT.
So, how to do
/(regexp){0}/
? (2 Replies)
Hi everyone, I would really appreciate any help I could get on the following topic.
I am not very familiar with reg expressions nor with sed, I just know the basic uses. What I am trying to do is the following: I have a huge text file where I would like to replace all occurnces of a certain... (13 Replies)
I would like to extract "1333 Fairlane" given the below text.
The word "Building:" is always present. The wording between Building and the beginning of the address can be almost anything. It appears the the hyphen is there most of the time.
Campus: Fairlane Business Park
Building:... (9 Replies)
Hello,
This is a problem I've worked on a while and can't figure out.
There is a file.txt
..some stuff..
]
]
..some stuff..
The Awk program is trying to extract the year portion of the birth and death ("98: and "2nd C.") using the below technique
#!/bin/awk
@include... (5 Replies)
ESCAPESHELLCMD(3) 1 ESCAPESHELLCMD(3)escapeshellcmd - Escape shell metacharactersSYNOPSIS
string escapeshellcmd (string $command)
DESCRIPTION escapeshellcmd(3) escapes any characters in a string that might be used to trick a shell command into executing arbitrary commands. This
function should be used to make sure that any data coming from user input is escaped before this data is passed to the exec(3) or system(3)
functions, or to the backtick operator.
Following characters are preceded by a backslash: #&;`|*?~<>^()[]{}$, x0A and xFF. ' and " are escaped only if they are not paired. In
Windows, all these characters plus % are replaced by a space instead.
PARAMETERS
o $command
- The command that will be escaped.
RETURN VALUES
The escaped string.
EXAMPLES
Example #1
escapeshellcmd(3) example
<?php
// We allow arbitrary number of arguments intentionally here.
$command = './configure '.$_POST['configure_options'];
$escaped_command = escapeshellcmd($command);
system($escaped_command);
?>
Warning
escapeshellcmd(3) should be used on the whole command string, and it still allows the attacker to pass arbitrary number of argu-
ments. For escaping a single argument escapeshellarg(3) should be used instead.
SEE ALSO escapeshellarg(3), exec(3), popen(3), system(3), backtick operator.
PHP Documentation Group ESCAPESHELLCMD(3)