Need help with Perl regex
From: surfking (bkimelman_at_JUNK.sympatico.ca)
Date: 01/07/05
- Next message: A. Sinan Unur: "Re: Input - read file - return webpage"
- Previous message: Eric Peterson: "shutdown of linux box from cron perl script"
- Next in thread: Jim Keenan: "Re: Need help with Perl regex"
- Reply: Jim Keenan: "Re: Need help with Perl regex"
- Reply: Eric Bohlman: "Re: Need help with Perl regex"
- Reply: Joe Smith: "Re: Need help with Perl regex"
- Reply: Tom Regner: "Re: Need help with Perl regex"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 6 Jan 2005 18:49:34 -0500
I found this line of code
which was parsing the /etc/termcap file located on a UNIX system.
if (/(^|\|)${term}[:\|]/) {
I used the code from which this line was extracted and it successfully
parsed/extracted the termcap entry for my particulat type of terminal.
I realize that the "^" character is used to anchor the pattern match to
the start of a buffer and that enclosing part of a pattern match within
a set of parenthesis enables you to retrieve the value of the matched
segment and that "|" is used as an "logical or" operator, but given the
format of entries in the /etc/termcap file, I don't see how this pattern
is successfull. Can anyone out there give me some ideas on this ?
- Next message: A. Sinan Unur: "Re: Input - read file - return webpage"
- Previous message: Eric Peterson: "shutdown of linux box from cron perl script"
- Next in thread: Jim Keenan: "Re: Need help with Perl regex"
- Reply: Jim Keenan: "Re: Need help with Perl regex"
- Reply: Eric Bohlman: "Re: Need help with Perl regex"
- Reply: Joe Smith: "Re: Need help with Perl regex"
- Reply: Tom Regner: "Re: Need help with Perl regex"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]