}
if ( $data[0] =~ m/(^{\*+$)/ ){
}
With the above match i am able to identify the comment and skip it to get the next line..
Out:
{test : test...test }
If the same comment consists of any space or any character in the place of *, my match fails..
IN:
{** ***** or {* abccd or {*abce
All the above cases are failed to skip ... What might be worng in the match,...can any one help me out..
^{\*+$
^: line start
{: literal "{"
\*: literal "*"
+: repetition
$: end of line
So if there's anything else than just {******, the match fails.
Removing the dollar sign from the regexp would do the trick for the examples you gave. But except this is a programming exercise, I'd suggest using an existing syntax with existing, robust parser, instead of re-inventing the wheel.
Bookmarks