in reply to regular expressions
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regular expressions
by reasonablekeith (Deacon) on Mar 01, 2005 at 08:50 UTC | |
|
Re^2: regular expressions
by wannabeboy (Novice) on Mar 01, 2005 at 08:56 UTC | |
by brian_d_foy (Abbot) on Mar 01, 2005 at 09:01 UTC | |
by Random_Walk (Prior) on Mar 01, 2005 at 09:18 UTC | |
by Jasper (Chaplain) on Mar 01, 2005 at 10:13 UTC | |
by Random_Walk (Prior) on Mar 01, 2005 at 13:47 UTC |