goldenradium2001
Technical User
Here's my question that I posted in the UNIX Scripting forum before I discovered there was a wonderful awk forum. I'm dealing with three metacharacters...+, *, and ?. Here's my file:
Jeen
Jeff
Jessica
Jerry
John
Jo
Josh
Here's my awk statements:
nawk '/Je+/' file
nawk '/Je*/' file
nawk '/Je?/' file
For the first statement it only retrieves:
Jeen
Jeff
Jessica
Jerry
For the second statement, it retrieves all records.
For the third statement, it retrieves all records.
Is there something wrong in my syntax? Or is this a bad example to show the differences between the +, ?, and * metacharacters? Help?? Can anyone give me a better clearer example of how these metacharacters would work?
Thanks!
Jeen
Jeff
Jessica
Jerry
John
Jo
Josh
Here's my awk statements:
nawk '/Je+/' file
nawk '/Je*/' file
nawk '/Je?/' file
For the first statement it only retrieves:
Jeen
Jeff
Jessica
Jerry
For the second statement, it retrieves all records.
For the third statement, it retrieves all records.
Is there something wrong in my syntax? Or is this a bad example to show the differences between the +, ?, and * metacharacters? Help?? Can anyone give me a better clearer example of how these metacharacters would work?
Thanks!