Re: Need help with Perl regex
From: Joe Smith (joe_at_inwap.com)
Date: 01/07/05
- Next message: Joe Smith: "Re: perl crash on sucking $socket into array"
- Previous message: Joe Smith: "Re: shutdown of linux box from cron perl script"
- In reply to: surfking: "Need help with Perl regex"
- Next in thread: Tom Regner: "Re: Need help with Perl regex"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 07 Jan 2005 01:58:07 -0800
surfking wrote:
> I found this line of code
> which was parsing the /etc/termcap file located on a UNIX system.
>
> if (/(^|\|)${term}[:\|]/) {
>
> 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 ?
It's designed to match entries like this:
ibmpcx|xenix|ibmx|IBM PC xenix console display:
For $term = 'ibmpcx', /^$term[|]/ matches.
For $term = 'xenix', /\|$term[|]/ matches. Same for 'ibmx'.
For $term = 'IBM PC xenix console display', /\|$term[:]/ matches.
For entries that have no aliases, /^$term[:]/ matches.
-Joe
- Next message: Joe Smith: "Re: perl crash on sucking $socket into array"
- Previous message: Joe Smith: "Re: shutdown of linux box from cron perl script"
- In reply to: surfking: "Need help with Perl regex"
- Next in thread: Tom Regner: "Re: Need help with Perl regex"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]