Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
March 30, 2008, 2:56 pm
rate this thread
I want to find the pattern: PATTERN that can contain lower case or
upper case characters, digits, and special characters like : _ ; ( )
A sample context is:
-- Start here (this line is not in context)
@ a line containing anything(comment line)
@ multiple comment lines can exist
// Another type of comments
/* Third type of comments
and it's a multiline comment
x1=a AND b
y1= x1 OUTSIDE layer100
//Comments can exist anywhere in the text (between the braces)
// this is the closing brace }
-- End here (this line is not in context)
I need when apply regular expression on the above sample context, it
return the word PATTERN.
Any guidance about the most efficient RE to perform that?
Thanks and best regards,
Re: How to find this pattern by regular expression?
my($match) = $context =~ /(PATTERN)/;
You should first try to find ANY regex that does what you want.
Only if it proves to be too slow should you concern yourself with
making it faster.
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"
- » FAQ 7.29 How can I use a variable as a variable name?
- — Previous thread in » PERL Discussions
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum