On 2012-12-28 21:32, twle...@reagan.com wrote:
I hope this is a simple fix. I want to check the beginning characters of items in a
hash, and compare that to a scalar variable. I do not need for the entire value to
match; just the first couple of characters. Here is a simple example of what
I hope this is a simple fix. I want to check the beginning characters of items
in a hash, and compare that to a scalar variable. I do not need for the entire
value to match; just the first couple of characters. Here is a simple example
of what I want, but it does not work. Both if
Hi,
my $prefix_search_list = '03S,04S';
my @prefix_array = split /\,/,$prefix_search_list;
my %prefix_hash = map {$_ = 1 } @prefix_array;
#compare 05S to 03S and 04S
my $input_field = 05S885858; #should not match
1. using stricts and warnings pragma, shows clearly that there is nothing
Tim wrote in message news:1356726727.215915...@webmail.reagan.com...
I hope this is a simple fix. I want to check the beginning characters of
items in a hash, and compare that to a scalar variable.
I do not need for the entire value to match; just the first couple of
characters.
Tim
my
Hello Chris,
Please see my comment below.
On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley char...@pulsenet.comwrote:
Tim wrote in message news:1356726727.215915216@**webmail.reagan.com...
I hope this is a simple fix. I want to check the beginning characters of
items in a hash, and
Chris Charley wrote in message news
Tim wrote in message news:1356726727.215915...@webmail.reagan.com...
I hope this is a simple fix. I want to check the beginning characters of
items in a hash, and compare that to a scalar variable.
I do not need for the entire value to match; just the
@perl.org
Subject: Re: Pattern matching to hash
Hi,
my $prefix_search_list = '03S,04S';
my @prefix_array = split /\,/,$prefix_search_list;
my %prefix_hash = map {$_ = 1 } @prefix_array;
#compare 05S to 03S and 04S
my $input_field = 05S885858; #should not match
1. using stricts
Thank you Chris. Using strict and warnings should have been the first thing
that I did. Thank you also for the code correction.
-Original Message-
From: Chris Charley [mailto:char...@pulsenet.com]
Sent: Friday, December 28, 2012 5:52 PM
To: beginners@perl.org
Subject: Re: Pattern
timothy adigun wrote in message
news:CAEWzkh6mZohVJn__LRL60AGoqbHkmTPyn=JM=cewcmmftpj...@mail.gmail.com...
Hello Chris,
Please see my comment below.
On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley
char...@pulsenet.comwrote:
[snip]
I only answered the question using a for loop. Am
Hi All
I have one output of one my command like :
$output = Step 155 of 171 steps.Executing.
Step 168 of 171 steps.Executing.
Step 171 of 171 steps.Executing.
Local:
On Thu, Mar 8, 2012 at 11:03 AM, sunita.prad...@emc.com wrote:
Hi All
I have one output of one my command like :
$output = Step 155 of 171
steps.Executing.
Step 168 of 171 steps.Executing.
Step 171 of 171
On 08/03/2012 17:03, sunita.prad...@emc.com wrote:
Hi All
I have one output of one my command like :
$output = Step 155 of 171 steps.Executing.
Step 168 of 171 steps.Executing.
Step 171 of 171
Trying to match the what is contained in $what 3 consecutive times.
But I am getting the followoing error:
Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7.
The program:
#!/usr/bin/perl
use warnings;
use strict;
my $what = 'fred|barney';
if (/($what){3}/) {
print
On 11-09-27 05:30 PM, Chris Stinemetz wrote:
Trying to match the what is contained in $what 3 consecutive times.
But I am getting the followoing error:
Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7.
The program:
#!/usr/bin/perl
use warnings;
use strict;
my $what
Hello again,
Yesterday I had a question on pattern matching. A couple of people responded
with very useful information. After some finagling, I got my rudimentary
code to work. I'm a PhD student studying computational linguistics without
any formal programming training. While there are various
On Sun, Nov 14, 2010 at 11:42 AM, Zachary Brooks
zbro...@email.arizona.eduwrote:
Hello again,
Yesterday I had a question on pattern matching. A couple of people
responded
with very useful information. After some finagling, I got my rudimentary
code to work. I'm a PhD student studying
On 10-11-14 11:42 AM, Zachary Brooks wrote:
$hello = This is some sample text.;
$hello =~ s/^../s/gi;
$hello =~ s/..$/\/s/gi;
print $hello\n;
*sis is some sample tex/s*
The meta-character '.' matches every character except a newline. The
first substitution replaces 'Th' with 's'. The
sw == shawn wilson ag4ve...@gmail.com writes:
sw second, why not use a place holder like someone recommended yesterday?
sw something like:
sw s/^(.+)$/s\1\/s/g
what is a placeholder? nothing like that in regexes. what you have there
is a backreference and used in the wrong place. \1 is
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman u...@stemsystems.com wrote:
sw == shawn wilson ag4ve...@gmail.com writes:
sw second, why not use a place holder like someone recommended yesterday?
sw something like:
sw s/^(.+)$/s\1\/s/g
what is a placeholder? nothing like that in regexes.
On 14/11/2010 13:53, Zachary Brooks wrote:
Hey Rob,
Of all the feedback. yours was the one I was able to drop into my code
and make it work, no matter how rudimentary my understanding of Perl is.
Thanks.
You're welcome. I'm glad to be able to help.
As far as the XML libraries, we are
so, if you've got a file, do something like:
while ($line = FH ) {
$line =~ m/^(.+)$/ig;
print s$1\/s\n;
}
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman u...@stemsystems.com wrote:
sw == shawn wilson ag4ve...@gmail.com writes:
sw second, why not use a place holder like someone recommended
On 14/11/2010 19:04, Zachary Brooks wrote:
What happened when I used the code --
$hello =~ s/^(.+)$/s\1\/s/gis;
-- is that is properly markeds and the beginning of the sentence and/s
at the end of the sentence, but then it only worked for one sentence.
Any suggestions on gettings to appear
At 2:16 PM -0500 11/14/10, shawn wilson wrote:
so, if you've got a file, do something like:
while ($line = FH ) {
$line =~ m/^(.+)$/ig;
print s$1\/s\n;
}
If all you want to do is print each line in the file surrounded bys
tags, you don't need regular expressions, and you don't need to
Hello,
I'm taking a PhD course that requires the use of Perl and pattern matching.
I've taken on the motto divide and conquer, but it hasn't quite worked. I
appreciate anyone's help.
The task is to extract sentences from a relatively large text file (928K,
ca. 300 pages). But of course, the text
On 10-11-13 01:42 PM, Zachary Brooks wrote:
1. My first approach was to use substitute to get rid of a range of things
betweenDOC and/DATELINE. A short version looks like this.
$hello = DOC man at the bar order the/DATELINE;
$hello =~ s/DOC.*\/DATELINE//gi;
print $hello\n;
I was about to
I've had similar issues and the \Q \E flags didn't fix it.
One thing I've done to fix an issue where regex metacharacters are being
caught is to do a replace on all of the characters to include a \ right in
front.
Something like this:
open (my $FILE, , $file) or die $!\n;
my @lines = $FILE;
for
On 13/11/2010 18:42, Zachary Brooks wrote:
Hello,
I'm taking a PhD course that requires the use of Perl and pattern matching.
I've taken on the motto divide and conquer, but it hasn't quite worked. I
appreciate anyone's help.
The task is to extract sentences from a relatively large text file
Hi all,
Iam beginner to perl i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = hi123now456itstimeforsplit789right
my @array = split ( '/(\d+\s)/ ',$string);
## Trying to split using digitnumber
On Mon, Jul 19, 2010 at 08:14, Chandan Kumar chandan_28...@yahoo.com wrote:
snip
my $string = hi123now456itstimeforsplit789right
my @array = split ( '/(\d+\s)/ ',$string);
snip
When I run the program ,it prints the whole string. so my assumption is wrong.
please Could some one explain me on
Chandan Kumar wrote:
Hi all,
Hello,
Iam beginner to perl i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = hi123now456itstimeforsplit789right
my @array = split ( '/(\d+\s)/ ',$string);
##
Thanks guys, I could able to understand split fun.
--- On Mon, 19/7/10, John W. Krahn jwkr...@shaw.ca wrote:
From: John W. Krahn jwkr...@shaw.ca
Subject: Re: usage of Split on pattern matching
To: Perl Beginners beginners@perl.org
Date: Monday, 19 July, 2010, 4:29 PM
Chandan Kumar wrote:
Hi
On Mon, 12 Apr 2010 23:04:53 -0500, Owen Chavez wrote:
Can you suggest a reference on hashes that will provide some clue as to
how they can be used for the problem I posted? I've looked over
Programming Perl (3rd) and it's not entirely clear to me how to proceed
with a hash.
Learning Perl
Owen Chavez wrote:
Hello!
I have a pattern matching question using Perl 5.10, Windows 7. Suppose I
have a file containing the following block of text:
Hello there TODD
I my We Us ourselves OUr I.
The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns
that I have
Hello!
I have a pattern matching question using Perl 5.10, Windows 7. Suppose I
have a file containing the following block of text:
Hello there TODD
I my We Us ourselves OUr I.
The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns
that I have no interest in).
I've
On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote:
I have a pattern matching question using Perl 5.10, Windows 7. Suppose
I have a file containing the following block of text:
Hello there TODD
I my We Us ourselves OUr I.
The file has 10 words, including 7 first-person pronouns (and 3
(3rd) and it's not entirely clear to me how to proceed with a hash.
Owen
On Mon, Apr 12, 2010 at 10:11 PM, Peter Scott pe...@psdt.com wrote:
On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote:
I have a pattern matching question using Perl 5.10, Windows 7. Suppose
I have a file
Hi,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
foreach (0..7) {
my $piece = $ref-[$_];
Richard Hobson m...@richardhobson.com wrote:
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
foreach (0..7) {
Firstly, apologies for the double posting of this question.
On Wed, 01 Apr 2009 09:49 +0200, Thomas Bätzler
t.baetz...@bringe.com wrote:
How about (untested):
sub display_board {
foreach my $ref (@_){
foreach my $piece ( @$ref ){
print substr( $piece, -2);
}
}
}
Hi,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
foreach (0..7) {
my $piece = $ref-[$_];
On Tue Mar 31 2009 @ 3:32, Richard Hobson wrote:
It works, but is there a way of combining these lines:
my $piece = $ref-[$_];
$piece =~ /.*(..$)/;
It feels like this could be done in one step. Is this correct? I'm
finding that I'm doing
Richard Hobson wrote:
Hi,
Hello,
Please be patient with this beginner. I have a subrouting as follows,
that prints out an ASCII representation of chess board
sub display_board {
foreach (0..7) {
my $ref = @_[$_];
That should be:
my $ref = $_[$_];
Or better:
]
Sent: Tuesday, September 23, 2008 6:52 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA sequences ie they are exclusively composed of the letters
A, T, G, C- no spaces
to have other strings that are made of
word/digit/space characters.
i tried
if($x=~ /[ATGC]/ )then .
however this pattern matching expression is unable to filter out the non-DNA
sequences.
i have also tried other expressions too convoluted to write out here.
any ideas?
Your question
PROTECTED]
Sent: Tuesday, September 23, 2008 6:52 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA sequences ie they are exclusively composed of the letters
A, T, G, C
hi all,
the column is in a text file. fyi, david's pattern matching expression
(/^[ATGC]+$/i) did the job perfectly.
thanks all for you feedback!
anjan
On Tue, Sep 23, 2008 at 5:07 AM, sanket vaidya [EMAIL PROTECTED]wrote:
Hi Anjan,
Not able to get where your column is. I am Assuming
Hey All,
I hope that you can help me. I have been struggling with this issue the past
couple of hours and can't seem to get it to work.
I am trying to get a value through pattern matching.
Here is the string:
xsl:output method=html encoding=utf-8 indent=yes
doctype-system=http://www.w3.org
On Tue, 2008-09-23 at 14:05 -0700, Darren Nay wrote:
Here is the string:
xsl:output method=html encoding=utf-8 indent=yes
doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN /
Now, I want to match against that string
tried
if($x=~ /[ATGC]/ )then .
however this pattern matching expression is unable to filter out the non-DNA
sequences.
i have also tried other expressions too convoluted to write out here.
any ideas?
tia,
anjan
--
=
anjan purkayastha, phd
bioinformatics analyst
-Original Message-
From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 23 September 2008 11:22 AM
To: beginners@perl.org
Subject: pattern matching question
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA
Dear List
I have a very large file basically it is logfile generated by sql
loader. In the production environment this file can have one
million/ two million data. In this file there are 4 particular lines which
i need to extract from this log file.
*Total logical records skipped:
Anirban Adhikary wrote:
Subject: Pattern matching problem
As far as I can tell, this is not a pattern matching problem.
I have a very large file basically it is logfile generated by sql
loader. In the production environment this file can have one
million/ two million data
HI, I'm looking for some advice of how to do this?
I need to match some variable pattenrs so
I define a $match variable and use it in the patterr below.
However it didn't match anything for the sample data.
If I change the match critia to hardcode
next unless /\s+BCV\s+N/Grp/;
Jin Zhisong wrote:
HI, I'm looking for some advice of how to do this?
I need to match some variable pattenrs so
I define a $match variable and use it in the patterr below.
However it didn't match anything for the sample data.
If I change the match critia to hardcode
On 12/19/07, Jin Zhisong [EMAIL PROTECTED] wrote:
next unless /\s+BCV\s+N/Grp/; it works
Oh, I hope it doesn't work. The number of forward slashes is all wrong.
next unless /\s+BCV\s+N\/Grp/; it didn't work
But this one might actually parse. If it doesn't match when it's
supposed
Jin Zhisong schreef:
I define a $match variable and use it in the patterr below.
However it didn't match anything for the sample data.
perldoc -f qr
--
Affijn, Ruud
Gewoon is een tijger.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks every one that helps. I find my problem. Now how
can I have a $pattern that contain some special characters
to pass it into regex?
I want to extract the line that contains either
RAID-5N/Grp'd
Or
BCV N/Asst'd
The following code didn't
On 12/19/07, Jin Zhisong [EMAIL PROTECTED] wrote:
The following code didn't work.
my $pattern = ( $type eq 'bcv' ) ? ${match}\s+N\/Asst :
${match}\s+N\/Grp ;
Did it not work because it did not use qr//? That's at least part of
the problem. It may help you during development if you output
Jin Zhisong wrote:
The following code didn't work.
My $type = $ARGV[1]
my $match = ( $type eq 'bcv' ) ? 'BCV' : 'RAID-5' ;
my $pattern = ( $type eq 'bcv' ) ? ${match}\s+N\/Asst :
${match}\s+N\/Grp ;
while ( DATA )
Hi,
I hope this is simple, as i am very new to perl.
I am trying to use pattern matchinig to create many srcipts from
a template file which i have read into a list then print out to files.
the problem is the patter match only matches on the first 2 successful matches
after that it keeps the
On 8/29/07, Jim [EMAIL PROTECTED] wrote:
Hi,
I hope this is simple, as i am very new to perl.
I am trying to use pattern matchinig to create many srcipts from
a template file which i have read into a list then print out to files.
the problem is the patter match only matches on the first 2
On 8/28/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
When i write the condition
my @m = $fullStruct =~ /$DLstatement/g;
and try printing the array,
print \nThe array is @m\n;
It prints nothing This is the problem...
Thanks and Regards,
Dharshana
snip
That is not the
Dharshana Eswaran wrote:
On 8/28/07, Chas Owens [EMAIL PROTECTED] wrote:
On 8/28/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
I have a pattern, which reads as shown below:
my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
my $identifier = qr{ [A-Za-z_]\w* }xs;
my $statement = qr{
On 8/28/07, Chas Owens [EMAIL PROTECTED] wrote:
On 8/28/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
When i write the condition
my @m = $fullStruct =~ /$DLstatement/g;
and try printing the array,
print \nThe array is @m\n;
It prints nothing This is the problem...
Hi All,
I have a pattern, which reads as shown below:
my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
my $identifier = qr{ [A-Za-z_]\w* }xs;
my $statement = qr{
\s*
($identifier)
\s+
($identifier)
On 8/28/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
Hi All,
I have a pattern, which reads as shown below:
my $comment= qr{\s* (?:/\* .*? \*/ \s*)*}xs;
my $identifier = qr{ [A-Za-z_]\w* }xs;
my $statement = qr{
\s*
($identifier)
When i write the condition
my @m = $fullStruct =~ /$DLstatement/g;
and try printing the array,
print \nThe array is @m\n;
It prints nothing This is the problem...
Thanks and Regards,
Dharshana
On 8/28/07, Chas Owens [EMAIL PROTECTED] wrote:
On 8/28/07, Dharshana Eswaran [EMAIL
Dharshana Eswaran 写道:
Hi All,
I am trying to extract strings from few files. The content of the file
reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for
Hi All,
I am trying to extract strings from few files. The content of the file reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for indicators */
Dharshana Eswaran schreef:
$xyz =~ /\s*(\w+)\s+(\w+);/;
$b = $2; #variable name is stored here
...
But the variables like pp_lac[COMMON_TYPE_MAX] and
pp_plmn_list[COMMON_TYPE_MAX] are not getting stored because of the
special character used inbetween the names.
Then don't
Hi All,
I am trying to extract few strings from a text file. The pattern of the text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID, TF_MNSS_MESSAGE_CATEGORY + 0x01 and
How about this?
#!/usr/local/bin/perl
use strict;
use warnings;
my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY +
0x01) /* @LOG MNSS_MESSAGE_T */';
my @parts = $string =~ m/\S+?(\w+)\s+?\((\w+.*?)\)[EMAIL PROTECTED](\w+).*/;
use Data::Dumper;
print Dumper @parts;
On 5/17/07, Rob Coops [EMAIL PROTECTED] wrote:
How about this?
#!/usr/local/bin/perl
use strict;
use warnings;
my $string = '#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY
+ 0x01) /* @LOG MNSS_MESSAGE_T */';
my @parts = $string =~ m/\s+?(\w+)\s+?\((\w+.*?)\)[EMAIL
Thank you But i want to try without using any perl modules. Can you
suggest some way with no modules used in that?
Thanks and Regards,
Dharshana
On 5/17/07, Rob Coops [EMAIL PROTECTED] wrote:
On 5/17/07, Rob Coops [EMAIL PROTECTED] wrote:
How about this?
#!/usr/local/bin/perl
use
Sure, though I do not see why you would not want to use strict and warnings
(you should should should or the people on this list will hunt you down and
) anyway Data::Dumper was just there for convenience:
#!/usr/local/bin/perl
#use strict;
#use warnings;
my $string = '#define
Subject: Regarding pattern matching
Hi All,
I am trying to extract few strings from a text file. The pattern of the
text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /*
@LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID
Dharshana Eswaran wrote:
Hi All,
I am trying to extract few strings from a text file. The pattern of
the text
stored in the file is as follows:
#define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01)
/* @LOG
MNSS_MESSAGE_T */
I need to extract MNSS_FACILITY_IND_ID,
Of Course Rob, i always use strict and warnings... Since i had to write a
pseudocode, i did not write them. But i wil lsurely keep this in mind. :-)
Thank you... :-)
On 5/17/07, Rob Coops [EMAIL PROTECTED] wrote:
Sure, though I do not see why you would not want to use strict and
warnings (you
Dharshana Eswaran wrote:
On 3/9/07, John W. Krahn [EMAIL PROTECTED] wrote:
Chas Owens wrote:
[snip]
(
\w+ |
\d+ |
0x[a-fA-F0-9]
That only matches a single hexadecimal digit, you probably want
number too.
the 3rd string is sometimes is not present.
Once these are extracted, i can process it further to the requirement.
I tried reading each line, splitting it using spaces, grouping them using
pattern matching and then displaying. The code, which i wrote for this, is
written at the end
On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
Hi all,
I need to extract few strings from one file and paste it to another file.
snip
This doesn't seem like a good job for split. The split function is
good for parsing X separated records where X is either constant or
simple. What you
or sometimes it can
be a 2 digit decimal number too.
the 3rd string is sometimes is not present.
Once these are extracted, i can process it further to the requirement.
I tried reading each line, splitting it using spaces, grouping them using
pattern matching and then displaying. The code, which i wrote
Chas Owens wrote:
On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
I need to extract few strings from one file and paste it to another file.
snip
This doesn't seem like a good job for split. The split function is
good for parsing X separated records where X is either constant or
On 3/9/07, John W. Krahn [EMAIL PROTECTED] wrote:
Chas Owens wrote:
On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
I need to extract few strings from one file and paste it to another
file.
snip
This doesn't seem like a good job for split. The split function is
good for parsing X
Dharshana Eswaran schreef:
TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
TAPI_TTY_NOTIFY_TTY_TONE_MSGID
[...]
Can anyone help me in getting a generalised pattern from these?
m/^ TAPI (?:_[A-Z]+)+ $/x
--
Affijn, Ruud
Gewoon is een tijger.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
On 2/21/07, Dr.Ruud [EMAIL PROTECTED] wrote:
Dharshana Eswaran schreef:
TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
TAPI_TTY_NOTIFY_TTY_TONE_MSGID
[...]
Can anyone help me in getting a generalised pattern from these?
m/^ TAPI (?:_[A-Z]+)+ $/x
--
Affijn, Ruud
Gewoon is een tijger.
--
To
On 2/21/07, Dharshana Eswaran [EMAIL PROTECTED] wrote:
On 2/21/07, Dr.Ruud [EMAIL PROTECTED] wrote:
Dharshana Eswaran schreef:
TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
TAPI_TTY_NOTIFY_TTY_TONE_MSGID
[...]
Can anyone help me in getting a generalised pattern from these?
m/^ TAPI
Dharshana Eswaran schreef:
m/^ #TAPI (?:_[A-Z]+)+ $/x
But this is filtering both the strings starting from TAPI and the
strings starting from #TAPI.
Yes, # starts a comment, so makes the regex equivalent to m/^/, which
will allways match.
echo 'abc' |
perl -nle '
/^ # test/x and
Hello All,
I have quite a number of strings which has some typical matches between
them. I am unable to come up with a generalised pattern for them.
Few among those strings are like this:
TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID
TAPI_TTY_NOTIFY_TTY_TONE_MSGID
TAPI_NOTIFY_CALL_LINE_INFO_MSGID
On 1/19/07, Igor Sutton [EMAIL PROTECTED] wrote:
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
--
Igor Sutton Lopes [EMAIL PROTECTED]
I used the above expression and it worked for me. Thanks you so much.
Thanks
On 1/19/07, Rob Dixon [EMAIL PROTECTED] wrote:
Igor Sutton wrote:
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
my @data = $string =~ m/=0x(..)/g;
:)
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
in a variable. I need to pull out only the
numbers and store them in a array. Like:
@array = (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
I am unable to get a pattern to try pattern matching and spliting
it.
How do i do this?
$ perl -le'
my $string =
{[0]=0x53,[1]=0x65,[2]=0x63,[3
= (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
I am unable to get a pattern to try pattern matching and spliting it.
How do i do this?
Thanks and Regards,
Dharshana
Hi Dharshana,
2007/1/19, Dharshana Eswaran [EMAIL PROTECTED]:
Hi All,
I have a string as shown below:
$string =
{[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8]=0x43,[9]=0x6F,[10]=0x64,[11]=0x65,[12]=0x00}
This is stored as a string in a variable. I need to pull
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
--
Igor Sutton Lopes [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Igor Sutton wrote:
I have an update:
my @data = $string =~ m/0x(\d{2})/g;
my @data = $string =~ m/0x(\S{2}),?/g;
Now I think it is right :)
my @data = $string =~ m/=0x(..)/g;
:)
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
and store them in a array. Like:
@array = (53, 65, 63, 75, 72, 69, 74, 79, 43, 6F, 64, 65, 00);
I am unable to get a pattern to try pattern matching and spliting it.
How do i do this?
$ perl -le'
my $string =
{[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
Hi,
I am a beginner in perl and am having a dickens of a time trying to
identify this pattern in messages. [URL
Here is what I have:
if ($FORM{'message} =~ /\[URL/ig) {
#do something;
}
Where
Hi,
I am a beginner in perl and am having a dickens of a time trying to identify
this pattern in messages. [URL
Here is what I have:
if ($FORM{'message} =~ /\[URL/ig) {
#do something;
}
Where $FORM('message') is a messaage that includes many lines and
[EMAIL PROTECTED] wrote:
Hi,
I am a beginner in perl and am having a dickens of a time trying to identify
this pattern in messages. [URL
Here is what I have:
if ($FORM{'message} =~ /\[URL/ig) {
#do something;
}
Where $FORM('message') is a messaage that includes many
1 - 100 of 472 matches
Mail list logo