I am struggling with regular expressions. I know the fundamentals, but when I want to add two conditions within one "/.../", I have no idea how to do that.
What I want is for the program to print only what is between ">" and "<" at each line, but only if there isn't another > or < within the original ones. For instance: >knowledge< is good and >knowled<ge< is bad. My while-loop looks like this:The (^\w+) should match only strings that start with one or more alphanumeric character. Although it doesn't quite work as hoped.while (<FILE>) { />(.+) and (^\w+)</; print "$1 "};
I appreciate any help you experts may provide.
In reply to Multiple conditions by Erosia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |