Hello all,
I am doing a pattern matching for a string in a shell script.
Here an apostrophe ( ' ) is also a part of a string hence it should also be part of the pattern. But somehow i can't seem to be able to include it.
I have tried using the backslash to escape it but to no success.
Also tried putting ' inside two others like this ' ' ' .... but this doesn't work as well.
Please help.
My code look something like this :
Code: ( text )
if( $0 ~ /^"[-a-zA-ZÀ-ÖØ-öø-ÿ<> ;0-9]+"/ )
{
}
else
{
}
The string should should have ( " ) at the start and the end and in between alpha-numeric characters with some special chars.
e.g : "Mont-l'pierre"
Thanks !!
Sid
I am doing a pattern matching for a string in a shell script.
Here an apostrophe ( ' ) is also a part of a string hence it should also be part of the pattern. But somehow i can't seem to be able to include it.
I have tried using the backslash to escape it but to no success.
Also tried putting ' inside two others like this ' ' ' .... but this doesn't work as well.
Please help.
My code look something like this :
Code: ( text )
if( $0 ~ /^"[-a-zA-ZÀ-ÖØ-öø-ÿ<> ;0-9]+"/ )
{
}
else
{
}
The string should should have ( " ) at the start and the end and in between alpha-numeric characters with some special chars.
e.g : "Mont-l'pierre"
Thanks !!
Sid
Comment