I have a program that I need to do some matching in. For example, I need to match the lexemes in a LISP function and print the token out to a file. For example:

if ($input =~ /(^\()/)
{
print OUTPUT "OPAREN $1\n";
$input =~ s/^\(//;
}

I need the matching for the parentheses, letters, digits, etc. I am confused when it comes to matching. Thanks for any input you may have.

As I've been helping you, I'm sure that this post is probably not needed to solve your problem any more, however, regex is a very important part of working with strings, and therefore, I have a page that helps breakdown regex into a pretty easy form:
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.