I think you want the regex I show in this little program. It starts with an "a", has one of more non-newline characters, then uses the alternation (f|g) to denote that the whole thing can end with either of those characters.
#!/usr/bin/perl while( <DATA> ) { chomp; print "$_ matches!\n" if /^a.+(f|g)$/; } __DATA__ axxxi bxg cxxf axxxh axxxg axxxf
In reply to Re: regular expressions
by brian_d_foy
in thread regular expressions
by wannabeboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |