Hi,
Can anyone help me to find regular expression for the following in Perl?
"The string can only contain lower case letters (a-z) and no more than one of any letter."
For example: "table" is accepted, whether "dude" is not.
I have coded like this:
$str = "table";
if ($str =~ m/\b()\b/) {... (4 Replies)
Hi Guys,
In the following line:
cn=portal.090710.191533.428571000,cn=groups,dc=mp,dc=rj,dc=gov,dc=br
I need to extract this string: portal.090710.191533.428571000
As you can see this string always will be bettween "cn=" and "," strings.
Someone know one regular expression to... (4 Replies)
My input contains a single word lines.
From each line
data.txt
prjtestBlaBlatestBlaBla
prjthisBlaBlathisBlaBla
prjthatBlaBladpthatBlaBla
prjgoodBlaBladpgoodBlaBla
prjgood1BlaBla123dpgood1BlaBla123
Desired output -->
data_out.txt
prjtestBlaBla
prjthisBlaBla... (8 Replies)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Hi,
I've a logfile which i need to parse and get the logs depending upon the user input. here, i'm providing an option to enter the string which can be matched with the log entries.
e.g. one of the logfile entry reads like this -
$str = " mpgw(BLUESOAPFramework):... (6 Replies)
i have a script in which i need to skip comments, and i am able to achieve it partially...
IN text file:
{****************************
{test : test...test }
Script:
while (<$fh>)
{
push ( @data, $_);
}
if ( $data =~ m/(^{\*+$)/ ){
}
With the above match i am... (5 Replies)
HI,
I'm new to perl and need simple regex for reading a file using my perl script.
The text file reads as -
filename=/pot/uio/current/myremificates.txt
certificates=/pot/uio/current/userdir/conf/user/gamma/settings/security/... (3 Replies)
Hello folks,
Looking for a quick help on regex in my perl script.
here's the string i want to parse and get the 2nd field out of it.
$str = " 2013-08-07 12:29 Beta ACTIVE";
I want to extract 'Beta' out of this string. This string will keep on changing... (2 Replies)
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Hi,
I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT CENTOS
posix_fallocate
POSIX_FALLOCATE(3) Linux Programmer's Manual POSIX_FALLOCATE(3)NAME
posix_fallocate - allocate file space
SYNOPSIS
#include <fcntl.h>
int posix_fallocate(int fd, off_t offset, off_t len);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
posix_fallocate():
_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L
DESCRIPTION
The function posix_fallocate() ensures that disk space is allocated for the file referred to by the descriptor fd for the bytes in the
range starting at offset and continuing for len bytes. After a successful call to posix_fallocate(), subsequent writes to bytes in the
specified range are guaranteed not to fail because of lack of disk space.
If the size of the file is less than offset+len, then the file is increased to this size; otherwise the file size is left unchanged.
RETURN VALUE
posix_fallocate() returns zero on success, or an error number on failure. Note that errno is not set.
ERRORS
EBADF fd is not a valid file descriptor, or is not opened for writing.
EFBIG offset+len exceeds the maximum file size.
EINVAL offset was less than 0, or len was less than or equal to 0.
ENODEV fd does not refer to a regular file.
ENOSPC There is not enough space left on the device containing the file referred to by fd.
ESPIPE fd refers to a pipe.
VERSIONS
posix_fallocate() is available since glibc 2.1.94.
CONFORMING TO
POSIX.1-2001.
POSIX.1-2008 says that an implementation shall give the EINVAL error if len was 0, or offset was less than 0. POSIX.1-2001 says that an
implementation shall give the EINVAL error if len is less than 0, or offset was less than 0, and may give the error if len equals zero.
SEE ALSO fallocate(1), fallocate(2), lseek(2), posix_fadvise(2)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2013-02-12 POSIX_FALLOCATE(3)