Re: Perl regex

2012-07-01 Thread Shawn H Corey
On 12-07-01 10:52 AM, Ken Slater wrote: ([^,]+),ERROR This would be the preferred method. (.*)?,ERROR (.*?),ERROR -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. _Perl links_ official sit

Re: Perl regex

2012-07-01 Thread Ken Slater
On Sun, Jul 1, 2012 at 9:12 AM, Chris Stinemetz wrote: > I have a two line pattern I would like to match and include 3 groupings. > > 59 REPT: EVDO: RNC 24 CP FAILURE SUMMARY SESSION RELEASE > RAN AUTH FAILURE PPP, ERROR CODE 51001 > > For final outcome I would like: > > $1 = 24 > $2 = CP F

Re: Perl Regex with unix grep command

2011-09-03 Thread Shlomi Fish
Hi all, On Sat, 03 Sep 2011 17:15:51 -0400 Shawn H Corey wrote: > On 11-09-03 05:01 PM, Jon Forsyth wrote: > > Hello, > > > > According to the grep manual page I can use the -P option to use Perl > > regular expressions as follows: > > > > grep -P PERL_REGEX INPUT_FILE > > > > however, I cannot

Re: Perl Regex with unix grep command

2011-09-03 Thread Uri Guttman
> "JF" == Jon Forsyth writes: JF> According to the grep manual page I can use the -P option to use JF> Perl regular expressions as follows: JF> grep -P PERL_REGEX INPUT_FILE just to let you know, nothing but perl can run perl regexes. all the ones that claim it are doing subsets and

Re: Perl Regex with unix grep command

2011-09-03 Thread Shawn H Corey
On 11-09-03 05:01 PM, Jon Forsyth wrote: Hello, According to the grep manual page I can use the -P option to use Perl regular expressions as follows: grep -P PERL_REGEX INPUT_FILE however, I cannot get the following pattern to match a literal dollar sign: grep -P makan\$ file.txt # You ha

Re: perl regex vs text editor syntax

2010-02-27 Thread Rob Dixon
jbl wrote: I am having trouble with a regex in perl. I have an array that looks like this: Abilene,KS,67410,1019 2000 Ave,38.88254,-97.20204,Grant Town Fire Dist *Arlington,KS,67514,100 W Main St,Reno County Fire Dist 4 Abilene,KS,67410,1463 3325 Ave,39.079136,-97.1181,Sherman Township Fire Distr

Re: perl regex to array

2004-10-05 Thread Gavin Henry
Ramprasad A Padmanabhan said: > Hi, > > I have slightly a tricky situation, in my large program. I am trying the > best to reproduce it > > > I have a string like this > $x='a{1}b{21}c{5}d'; > # The numbers in the {} are random and are not of interest > > I want to access all elements from the st

Re: perl regex to array

2004-10-04 Thread Jeff 'japhy' Pinyan
On Oct 4, Ramprasad A Padmanabhan said: > I have a string like this >$x='a{1}b{21}c{5}d'; ># The numbers in the {} are random and are not of interest > >I want to access all elements from the string 'a' 'b' 'c' & 'd' >How do I do it best ? I'd do: my @parts = split /{\d+}/, $string; -- Jeff

Re: perl regex to array

2004-10-04 Thread Jenda Krynicky
From: Ramprasad A Padmanabhan <[EMAIL PROTECTED]> > I have slightly a tricky situation, in my large program. I am trying > the best to reproduce it > > > I have a string like this > $x='a{1}b{21}c{5}d'; > # The numbers in the {} are random and are not of interest > > I want to access all elem

Re: Perl regex to C

2001-04-28 Thread Mike Lacey
Hi Robin, Have a look at the module B::CC which does pretty much what you ask for. You call it like this: perl -MO=CC[,OPTIONS] foo.pl This is from the standard documentation, there is also a section entitled BUGS which says: "Plenty. Current status: experimental." So, you've been warned :-)