On Mar 28, 2023, at 3:00 PM, Martin McCormick wrote:
>
> Uri Guttman writes:
>> yes, but he kept the {5,} repeat count. so i just kept it too.
>
> Now that I know how this works, I will probably change to
> {4,} as this would match 4 or more digits. From reading the
> documentation, {4} means
Uri Guttman writes:
> yes, but he kept the {5,} repeat count. so i just kept it too.
Now that I know how this works, I will probably change to
{4,} as this would match 4 or more digits. From reading the
documentation, {4} means 4 and only 4. {4,6} means 4 but nothing
else except 6. {N,}
Uri Guttman writes:
> you also quoted the whole regex in '' but included the // which are the
> normal regex delimiters. remove the outer quotes.
> and use the qr// form for regexes.
> and you don't want the + after the \d as the {5,} is the count. you can't
> have both types of repeat counts.
> m
On 3/28/23 16:07, Uri Guttman wrote:
On 3/28/23 17:01, Martin McCormick wrote:
Uri Guttman writes:
why are you escaping the {}?? those are meta chars that are needed to
make
that a 5+ range. just delete the backslashes on them and it will work.
First, thank you but read on, please.
I
Uri Guttman writes:
> why are you escaping the {}?? those are meta chars that are needed to make
> that a 5+ range. just delete the backslashes on them and it will work.
First, thank you but read on, please.
I couldn't agree more. That should do it but when I
don't escape them, I
On 3/28/23 16:17, Martin McCormick wrote:
The string I am interested in testing for starts with 5
or 6 digits in a row and all I need to do is determine that the
first 5 or 6 characters are numbers Period. That's all.
my $regextest = '/^\d+\{5,\}/' ;
why are you escaping the {}?? th
I've been fighting this for several days and it is a very simple
regular expression problem that should be easy enough for a
second grader but I can't seem to get it to work.
The string I am interested in testing for starts with 5
or 6 digits in a row and all I need to do is
Thanks a lot
Gautam S Desai
On Sun, Sep 8, 2019 at 6:39 PM Mike wrote:
>
> It's probably best if you write a short script
> that reads a __DATA__ section of data.
> Then tell us what it does and what you expected
> it to do.
>
> Off hand I don't see anything wrong with your regex,
> but I do
> On Sep 8, 2019, at 6:36 PM, Olivier wrote:
>
> Jim Gibson writes:
>
>> On Sep 8, 2019, at 3:39 PM, Mike wrote:
>>>
>>>
>>> It's probably best if you write a short script
>>> that reads a __DATA__ section of data.
>>> Then tell us what it does and what you expected
>>> it to do.
>>>
>>>
Jim Gibson writes:
> On Sep 8, 2019, at 3:39 PM, Mike wrote:
>>
>>
>> It's probably best if you write a short script
>> that reads a __DATA__ section of data.
>> Then tell us what it does and what you expected
>> it to do.
>>
>> Off hand I don't see anything wrong with your regex,
>> but I do
You are not doing anything with $t to test whether
it works. Also you are not telling us what data you
might test it with.
Mike
On 9/8/2019 6:41 PM, Jim Gibson wrote:
On Sep 8, 2019, at 3:39 PM, Mike wrote:
I expect it to return a positive value if $t contains a number anywhere within
i
On Sep 8, 2019, at 3:39 PM, Mike wrote:
>
>
> It's probably best if you write a short script
> that reads a __DATA__ section of data.
> Then tell us what it does and what you expected
> it to do.
>
> Off hand I don't see anything wrong with your regex,
> but I don't know what you expect it to d
It's probably best if you write a short script
that reads a __DATA__ section of data.
Then tell us what it does and what you expected
it to do.
Off hand I don't see anything wrong with your regex,
but I don't know what you expect it to do.
Mike
On 9/8/2019 4:34 PM, Jim Gibson wrote:
On Sep
On Sep 8, 2019, at 1:30 PM, Gautam Desai wrote:
>
> Do you guys have any pointers ?
$t =~ m{
( # capture matched number in $1
\d* # match zero or more decimal digits
[05] # followed by a '0' or '5'
)
Do you guys have any pointers ?
Thanks
Gautam S Desai
kidsforchess.org
https://www.facebook.com/kidsforchess.suwanee.9
https://www.21stcenturyleaders.org/youth-ambassador-starts-nonprofit-donates-to-21cl/
On Wed, 2018-06-13 at 21:21 -0500, Martin McCormick wrote:
> I wrote a small perl program to more quickly read all the
> subjects in an email list. One of the things the script does is
> to remove the mailing list name which repeats for every message
> and consists of a [, some English text and fi
Hi Dmitri,
On Thu, 14 Jun 2018 11:34:34 +0300
Дмитрий Ананьевский wrote:
> On Wed, 13 Jun 2018 21:21:12 -0500
> "Martin McCormick" wrote:
>
> > I wrote a small perl program to more quickly read all the
> > subjects in an email list. One of the things the script does is
> > to remove the maili
Hi,
On Wed, 13 Jun 2018 21:21:12 -0500
"Martin McCormick" wrote:
> I wrote a small perl program to more quickly read all the
> subjects in an email list. One of the things the script does is
> to remove the mailing list name which repeats for every message
> and consists of a [, some English te
On Wed, 13 Jun 2018 21:21:12 -0500
"Martin McCormick" wrote:
> I wrote a small perl program to more quickly read all the
> subjects in an email list. One of the things the script does is
> to remove the mailing list name which repeats for every message
> and consists of a [, some English text an
I wrote a small perl program to more quickly read all the
subjects in an email list. One of the things the script does is
to remove the mailing list name which repeats for every message
and consists of a [, some English text and finally a ].
I was able to write a RE that identifies that t
np = qr{ \( (?: (?> [^()]+ ) | (??{ $np }) )*
\) }x;$funpat = qr/$np/;} s/($funpat)=($funpat|(")[^\"]*
(")|[0-9\.]+)/"$1=$3".eval($1) ."$4"/ge'
That $np is from the camel book and it is a regular expression that parses
nested sets of parentheses
ions in VI and emacs/VI
> emulator mode:
>
>
>
> .! perl -MPOSIX -pe ' BEGIN{ $np = qr{ \( (?: (?> [^()]+ ) | (??{ $np })
> )* \) }x;$funpat = qr/$np/;} s/($funpat)=($funpat|(")[^\"]*
> (")|[0-9\.]+)/"$1=$3".eval($1)."$4"/ge'
>
> T
uot;$4"/ge'
That $np is from the camel book and it is a regular expression that parses
nested sets of parentheses and then my replace command evaluates the arithmetic
expression.
Since perl accommodates recursive regular expressions, it ought to be possible
to implement a recursive decent
ake a look at chromatic's Modern Perl, which is
> available for free [2].
>
> Regards, Simon
>
> Am 25.03.2015 um 06:01 schrieb Frank Vino:
> > Hi Team,
> >
> > How to understand Regular Expression in a easy way?
> >
> > Thanks,
> > Frank
>
>
On Wed, 25 Mar 2015 10:31:40 +0530
Frank Vino wrote:
> Hi Team,
>
> How to understand Regular Expression in a easy way?
>
> Thanks,
> Frank
Sorry Frank but there's no easy way. ☹
Some things to remember:
Some punctuation marks have special meaning, like perio
Am 25.03.2015 um 06:01 schrieb Frank Vino:
> Hi Team,
>
> How to understand Regular Expression in a easy way?
>
> Thanks,
> Frank
[1] Learning Perl, Sixth Edition by Randal L. Schwartz, brian d foy, and
Tom Phoenix
[2] http://onyxneon.com/books/modern_perl/
--
Hi Frank,
On Wed, 25 Mar 2015 10:31:40 +0530
Frank Vino wrote:
> Hi Team,
>
> How to understand Regular Expression in a easy way?
>
This page has links to some recommended tutorials about learning regular
expressions:
http://perl-begin.org/topics/regular-expressions/
*NOTE*:
AM, Frank Vino wrote:
>
>> Hi Team,
>>
>> How to understand Regular Expression in a easy way?
>>
>> Thanks,
>> Frank
>>
>
>
Just start using it and you will find it very easy to understand.
-Akshay
On Wed, Mar 25, 2015 at 10:31 AM, Frank Vino wrote:
> Hi Team,
>
> How to understand Regular Expression in a easy way?
>
> Thanks,
> Frank
>
Hi Team,
How to understand Regular Expression in a easy way?
Thanks,
Frank
Dear Jing,
I was confused when I started out the regular expression. Many thanks for the
kind and detailed explanation.
After reading more on perl regex, I think I have a better grasp of the
greedy/non-greedy concept now.
Your code also worked well for my task.
Regards,
Viet-Duc
when i change
use 5.16.0; to use feature ':5.10';
it works i get following output
bash-4.2$ ./regex.pl
Use of uninitialized value $3 in say at ./regex.pl line 7, line 1.
Use of uninitialized value $4 in say at ./regex.pl line 7, line 1.
Video1280x720
Use of uninitialized value $2 in say at ./re
On 17 Sep 2014, at 17:08, Uday Vernekar wrote:
> When i run this script i get following Error
>
> bash-4.2$ ./regex.pl
> feature version v5.16.0 required--this is only version v1.160.0 at ./regex.pl
> line 4.
> BEGIN failed--compilation aborted at ./regex.pl line 4.
>
>
>
> But I am using p
When i run this script i get following Error
bash-4.2$ ./regex.pl
feature version v5.16.0 required--this is only version v1.160.0 at ./
regex.pl line 4.
BEGIN failed--compilation aborted at ./regex.pl line 4.
But I am using perl version as swon below.
bash-4.2$ perl -v
This is perl 5, version
Hi Viet-Duc Le,
On 17 Sep 2014, at 10:23, Viet-Duc Le wrote:
> Greeting from S. Korea !
>
> I am parsing the output of ffmpeg with perl. Particular, I want to print only
> these lines among the output and capturing the resolution, i.e. 1280x720.
>
> Stream #0:0: Video: h264 (High), yuv42
p{margin:0;padding:0;}
Greeting from S. Korea !
I am parsing the output of ffmpeg with perl. Particular, I want to print only
these lines among the output and capturing the resolution, i.e. 1280x720.
Stream #0:0: Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98
fps, 23.9
Please find below the tested code, same regular expression match both the
patterns:
my $string1 = "^Modifications made by Danny Wong (danwong) on 2014/05/06
18:27:48 from database brms";
my $string2 = "^Modifications made by danwong on 2014/05/06 18:27:48 from
database brms"
On 05/07/2014 01:40 AM, John SJ Anderson wrote:
my @strings = (
"^Modifications made by Danny Wong (danwong) on 2014/05/06 18:27:48
from database brms" ,
"^Modifications made by danwong on 2014/05/06 18:27:48 from database brms²",
);
foreach my $string ( @strings ) {
my( $match ) = $s
On Tue, May 6, 2014 at 10:30 PM, Danny Wong (dannwong)
wrote:
> Both string are possible outputs, so I want to be able to grep for the
> username only.
Well, if the username will always be either the only thing between
'by' and 'on', or in parens if it's not...
#! /usr/bin/env perl
use strict;
2014/05/06 18:27:48 from
> database brms²;
>
> What is a regular expression where I can extract ³danwong² from either
> string (one string have () parentheses and the other doesn¹t have
> parentheses)?
>
I think you want to anchor on 'made by' and either match between
eses gives me this output.
$1 is Danny Wong (danwong
yes the last ) is missing, so it looks like I’m close, I’m not exactly
sure what is missing.
On 5/6/14, 10:25 PM, "John SJ Anderson" wrote:
>On Tue, May 6, 2014 at 10:19 PM, Danny Wong (dannwong)
> wrote:
>
>> What
On Tue, May 6, 2014 at 10:19 PM, Danny Wong (dannwong)
wrote:
> What is a regular expression where I can extract ³danwong² from either
> string (one string have () parentheses and the other doesn¹t have
> parentheses)?
I'm not entirely sure what you're trying to acco
Hi Guys,
I have the following strings.
my $str1="^Modifications made by Danny Wong (danwong) on 2014/05/06
18:27:48 from database brms";
#$str1="^Modifications made by danwong on 2014/05/06 18:27:48 from
database brms²;
What is a regular expression where I can extract
Chaps,
I am testing all your code one by one, Appreciate your time and detailed
inputs.
Many Thanks
Sj
On Fri, Aug 23, 2013 at 6:01 PM, Jim Gibson wrote:
>
> On Aug 23, 2013, at 9:06 AM, jet speed wrote:
>
> > Chaps,
> >
> > Please i need help on the regular ex
On Aug 23, 2013, at 9:06 AM, jet speed wrote:
> Chaps,
>
> Please i need help on the regular expression, i have the sample code below.
> I only want to match the entries from the array to the file and print the
> matching line
>
> for example if i only want to match
See sample code below
> Chaps,
>
> Please i need help on the regular expression, i have the sample code
> below.
> I only want to match the entries from the array to the file and print
> the
> matching line
>
> for example if i only want to match fc3/23, in my code i
On Fri, 23 Aug 2013 17:06:41 +0100
jet speed wrote:
> Chaps,
>
> Please i need help on the regular expression, i have the sample code
> below. I only want to match the entries from the array to the file
> and print the matching line
>
> for example if i only want to match
On Fri, 23 Aug 2013 17:06:41 +0100
jet speed wrote:
> my @check = (fc3/23, fc10/1, fc3/14, fc12/12);
my @check = qw( fc3/23 fc10/1 fc3/14 fc12/12 );
>
> my $f2 = 'out.txt';
> for my $element(@check) {
> open my $fh2, '<', $f2 or die "could not open $f2: $!";
> while (my $line = <$fh2>) {
> cho
Not sure I get it, but would
/^fc3\/2\b/
(assuming you're looking for fc3/2 and not fc3/23) work?
hth
paolino
On 23 Aug 2013, at 17:06, jet speed wrote:
> Chaps,
>
> Please i need help on the regular expression, i have the sample code below.
> I only want to match the
Chaps,
Please i need help on the regular expression, i have the sample code below.
I only want to match the entries from the array to the file and print the
matching line
for example if i only want to match fc3/23, in my code it prints both the
lines fc3/2 and fc3/23. How to restrict to exact
On 10/25/2012 05:24 PM, Andy Bach wrote:
On Thu, Oct 25, 2012 at 3:57 PM, Weidner, Ron wrote:
In the following regex what is the "t" character doing?
$linebuf =~ tr/\n/:/;
tr/// is the "translate", er, transliteration operator. Same as
"y///" - from/like a unix util ("tr"). Takes any of the
"tr/ACEGIBDFHJ/0246813579/". For sed devotees, "y" is
provided as a synonym for "tr". If the
SEARCHLIST is delimited by bracketing quotes, the
REPLACEMENTLIST has its own pair of quotes, which
may or may not be bracketing q
On 10/25/2012 03:57 PM, Weidner, Ron wrote:
In the following regex what is the "t" character doing?
$linebuf =~ tr/\n/:/;
There is no regexp - there is a tr operator
perldoc perlop
tr/SEARCHLIST/REPLACEMENTLIST/cds
y/SEARCHLIST/REPLACEMENTLIST/cds
Transliterates all occurrences of t
In the following regex what is the "t" character doing?
$linebuf =~ tr/\n/:/;
--
Ron
**
This e-mail is intended solely for the intended recipient or recipients. If
this e-mail is addressed to you in error or you othe
From: "Dr.Ruud"
On 2012-09-20 09:08, Octavian Rasnita wrote:
my ( $file_name ) = $data =~ /([^\\]+)$/g;
No need for that g-modifier.
--
Ruud
Yes, you are right. I added it by mistake.
Octavian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail:
On 2012-09-20 09:08, Octavian Rasnita wrote:
my ( $file_name ) = $data =~ /([^\\]+)$/g;
No need for that g-modifier.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
thanks a lot for all the responses :)
regards
From: Shlomi Fish
To: Michael Brader
Cc: beginners@perl.org
Sent: Thursday, September 20, 2012 2:53 PM
Subject: Re: regular expression help
On Thu, 20 Sep 2012 17:13:07 +0930
Michael Brader wrote:
> A m
On Thu, 20 Sep 2012 17:13:07 +0930
Michael Brader wrote:
> A more idiomatic way to do this is to use the File::Spec module.
> Inspect the output of this program for inspiration:
>
There's also File::Basename:
http://perldoc.perl.org/File/Basename.html
Regards,
Shlomi Fish
--
--
On 09/20/2012 04:39 PM, Irfan Sayed wrote:
got it myself :)
thanks a lot
$line_to_add =~ m/([a-zA-Z]+\.csproj)/;
Hi Irfan,
Your solution will only match files that consist of ASCII alphabetic
characters followed by '.csproj'. It will also match these:
* 'c:\p4\car\abc\foo.csproj\file.tx
got it myself :)
thanks a lot
$line_to_add =~ m/([a-zA-Z]+\.csproj)/;
regards
From: Irfan Sayed
To: Perl Beginners
Sent: Thursday, September 20, 2012 12:07 PM
Subject: regular expression help
i have string 'c:\p4\car\abc\xyz.csproj'
i ju
g;
print $file_name;
It will print:
xyz.csproj
( and ) captures the matched string but because in this case they capture
the whole regular expression, you can omit using them like:
my ( $file_name ) = $data =~ /[^\\]+$/g;
[^\\] means that it matches everything which is not a \ char, and be
i have string 'c:\p4\car\abc\xyz.csproj'
i just need to match the xyz.csproj
i tried few option but does not help.
can someone please suggest
regards
irfan
quot;(.es.){3}" before running Perl. Those
extra slashes you added tell "bash" to not interpret the parenthesis.
You could also get around the problem by quoting the regular expression on
the command line, like this:
# ./grep.pl '(.es.){3}' /usr/share/dict/words
Hope that helps.
--
Robert Wohlfarth
Hi
My program takes is supposed to take regular expression and a file
containing a list of words/lines as input and print all those lines
that match the regular expression. Below is the program
#!/usr/bin/perl
use strict;
use warnings;
sub grep_file {
my $pattern = shift;
my
>> "ug" == Uri Guttman writes:
ug> unpack would be a poor choice if the number of digits in a field
ug> changes. pack/unpack are meant for use in fixed field records.
That was a bad assumption on my side, I only considered the problem at
hand, thinking unpack will be faster that subst
> "ta" == timothy adigun <2teezp...@gmail.com> writes:
ta> You can use unpack:
ta>$val = "11.0.56.1";
ta>$new_val=unpack("x5 A2",$val); # skip forward 6, get 2
ta> print $new_val # print 56;
unpack would be a poor choice if the number of digits in a field
changes. pac
Hi Irfan,
You can use unpack:
$val = "11.0.56.1";
$new_val=unpack("x5 A2",$val); # skip forward 6, get 2
print $new_val # print 56;
On 10/09/2011 18:23, Irfan Sayed wrote:
hi,
i have following string.
$val = "11.0.56.1";
i need to write regular expression which should match only "56" and print
please suggest
I think you should forget about regular expressions and use split:
my $sub = (split
On 11-09-10 01:23 PM, Irfan Sayed wrote:
i have following string.
$val = "11.0.56.1";
i need to write regular expression which should match only "56" and print
please suggest
( $val =~ /(56)/ ) && print $1;
--
Just my 0.0002 million dollars worth,
S
Hi Irfan,
On Sat, 10 Sep 2011 10:23:31 -0700 (PDT)
Irfan Sayed wrote:
> hi,
>
> i have following string.
>
> $val = "11.0.56.1";
>
> i need to write regular expression which should match only "56" and print
>
There are any number of way
hi,
i have following string.
$val = "11.0.56.1";
i need to write regular expression which should match only "56" and print
please suggest
regards
irfan
On 15/07/2011 16:42, David Wagner wrote:
I have the following map:
map{[$_,(/^\d/ ? 1 : 0) . /^([^;]+)/,
/[^;]+;[^;]*;[^;]+;[^;]+;([^;]+);/]}
I had a failure during the night because some data field(s) had
a semi-colon in the data. So what I have is a
On 2011-07-15 17:42, Wagner, David --- Sr Programmer Analyst --- CFS wrote:
I have the following map:
map{[$_,(/^\d/ ? 1 : 0) . /^([^;]+)/,
/[^;]+;[^;]*;[^;]+;[^;]+;([^;]+);/]}
I had a failure during the night because some data field(s) had
a semi-colon
I have the following map:
map{[$_,(/^\d/ ? 1 : 0) . /^([^;]+)/,
/[^;]+;[^;]*;[^;]+;[^;]+;([^;]+);/]}
I had a failure during the night because some data field(s) had
a semi-colon in the data. So what I have is a pre-defined data separator
that would not nor
Hi All,
Thanks for your time and valuable inputs, Appreciate it.
I will try your suggestions and test it in my program.
Sj
On May 11, 8:38 am, speedj...@googlemail.com (jet speed) wrote:
> Hi All,
>
> I need help in matching the regular expression, the file is as below.
>
> I am trying to match number followed by Number ex 587, 128 in $1 and
> 60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $
On 11/05/2011 16:38, jet speed wrote:
> Hi All,
>
> I need help in matching the regular expression, the file is as below.
>
> I am trying to match number followed by Number ex 587, 128 in $1 and
> 60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
>
> the $1 match
On 11-05-11 11:38 AM, jet speed wrote:
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find with regulare expression #if
:D5:C2:BA:D9:DE:11
763 wwn is 60:06:01:60:50:40:21:00:25:C6:3F:A7:CA:2D:DF:11
On Wed, May 11, 2011 at 8:38 AM, jet speed wrote:
> Hi All,
>
> I need help in matching the regular expression, the file is as below.
>
> I am trying to match number followed by Number ex 587, 128 in $1 an
Hi All,
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find with regulare expression #if ($_=~
/\w{7}\s\w{4}\s\w{6}\s(\d{1,4})/i
21st and 22nd byte value. In the above
examples, they are both 05.
Could anybody tell me how to retrieve that value out of the strings
using regular expression?
Thanks in advance!
First of all, it would be far better to open whatever is being dumped
here and evaluate the fifth byte directly
the the 21st and 22nd byte value. In the above
> examples, they are both 05.
>
> Could anybody tell me how to retrieve that value out of the strings
> using regular expression?
>
> Thanks in advance!
substr
#!/usr/bin/perl
use strict;
while () {
my $substring20 = substr( $_,
2011/5/4 loudking :
> Hi there,
>
> Hereby I have a string parsing problem to ask. The sample strings look
> like this:
>
> : CC02 0565 8E93 D501 0100 6273 .eb
> : 6800 0500 9093 D501 0100 1400 h...
>
> What I am interested is the the 21st
examples, they are both 05.
Could anybody tell me how to retrieve that value out of the strings
using regular expression?
Thanks in advance!
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> "KK" == Karl Kaufman writes:
KK> Well, to be precise, your conceptual logic was fine; the
KK> implementation was flawed. As several have pointed out, you
KK> weren't replacing the comma with a _space_ *character*, but with
KK> the RegExp _whitespace_ *character class*.
to be really
- Original Message -
From: "Irfan Sayed"
To: "John W. Krahn" ; "Perl Beginners"
Sent: Thursday, April 28, 2011 9:28 AM
Subject: Re: regular expression
my logic was to just put the space character in place of comma and keep
rest as it is
but un
thanks all
From: Shawn H Corey
To: beginners@perl.org
Sent: Thursday, April 28, 2011 7:55 PM
Subject: Re: regular expression
On 11-04-28 10:05 AM, Irfan Sayed wrote:
> hi,
>
> i have following code.
>
>
> $target = "abc,xyz";
&g
: Re: regular expression
Irfan Sayed wrote:
> hi,
Hello,
> i have following code.
>
>
> $target = "abc,xyz";
> print "$target\n";
> $target =~ s/,/\s/g;
> print "$target\n";
>
> i need to replace "comma" with whitespace for st
On 11-04-28 10:05 AM, Irfan Sayed wrote:
hi,
i have following code.
$target = "abc,xyz";
print "$target\n";
$target =~ s/,/\s/g;
print "$target\n";
i need to replace "comma" with whitespace for string "abc,xyz"
the output shud be "a
hing that applies only to regular expressions but
the second part of the substitution operator is just a string, not a
regular expression. And which of the five whitespace characters should
this string interpolate "\s" as: " ", "\r", "n", "t" or &qu
applies only to regular expressions but
the second part of the substitution operator is just a string, not a
regular expression. And which of the five whitespace characters should
this string interpolate "\s" as: " ", "\r", "n", "t" or "\f&
hi,
i have following code.
$target = "abc,xyz";
print "$target\n";
$target =~ s/,/\s/g;
print "$target\n";
i need to replace "comma" with whitespace for string "abc,xyz"
the output shud be "abc xyz"
the above regular expression does not do that . please suggest
--irfan
Excellent Guys, I would like thank each one of you for inputs. Much
appreciated.
i got blinded by just the numbers 0079, i didn't cater for the next line
which is hex 007A, as one of you rightly pointed out [ 0-9A-Z] , does the
trick. its amazing to see different technique to achieve the same res
On 2011-04-27 18:47, Jim Gibson wrote:
The metasymbol \d matches the characters [0-9],
Beware: the \d matches 250+ code points. So don't use \d if you only
mean [0-9].
not the extended hexadecimal
set that includes A-Z. To match those, construct your own character class:
[0-9A-Z]
Or us
On Wed, Apr 27, 2011 at 2:48 PM, Shawn H Corey wrote:
> On 11-04-27 12:47 PM, Jim Gibson wrote:
>
>> The metasymbol \d matches the characters [0-9], not the extended
>> hexadecimal
>> set that includes A-Z. To match those, construct your own character class:
>>
>> [0-9A-Z]
>>
>
> You can use the
On 11-04-27 12:47 PM, Jim Gibson wrote:
The metasymbol \d matches the characters [0-9], not the extended hexadecimal
set that includes A-Z. To match those, construct your own character class:
[0-9A-Z]
You can use the POSIX xdigit character class instead:
#!/usr/bin/env perl
use strict;
use w
On Wed, Apr 27, 2011 at 04:32:57PM +0100, jet speed wrote:
> Hi all,
>
> Thanks for all our inputs,
>
> The regular expression below works fine if do it for single line, i am
> trying to caputre the match $1, and $2 into array. only the first line
> is pushed to the array.
On 4/27/11 Wed Apr 27, 2011 8:32 AM, "jet speed"
scribbled:
> Hi all,
>
> Thanks for all our inputs,
>
> The regular expression below works fine if do it for single line, i am
> trying to caputre the match $1, and $2 into array. only the first line
> is pushe
Hi all,
Thanks for all our inputs,
The regular expression below works fine if do it for single line, i am
trying to caputre the match $1, and $2 into array. only the first line
is pushed to the array. what am i doing wrong ?
how to get all the $1 and $2 match values for each line into arrary
On 27/04/2011 11:47, jet speed wrote:
Please could you advice, how can i write a regular expression for the
line below to capture 0079 and 69729260057253303030373
0079 Not Visible 69729260057253303030373
i tried this one, no luck
/(^\d{4})\s\w+\s\w+\s+\d+/ig
1 - 100 of 966 matches
Mail list logo