[Gambas-user] New highlighting component (episode 2)
Bruce Steers
bsteers4 at gmail.com
Sun Oct 29 01:49:08 CEST 2023
On Sun, 29 Oct 2023 at 00:01, Benoît Minisini <
benoit.minisini at gambas-basic.org> wrote:
> Le 29/10/2023 à 00:50, Bruce Steers a écrit :
> > after is required to be a comment.
> >
> >
> > It is # anywhere in a line starts a comment just NOT if it is inside
> > {curly braces}
> > i changed
> > from #
> > to be...
> > from /#\s/
> >
> > but it's a workaround as i do not know syntax for # if it's not inside {
> }
>
> What does "#" mean when it is between { and }?
>
pattern matching for one, # and ## will find first and last occurrence of
text
eg.
$ PATH="file:///etc/some/dir/file"
$ echo ${PATH#*/}
//etc/some/dir/file
$ echo ${PATH##*/}
file
% is used to get the left side # for the right side
it's also used to get numerical data, like the below example gets the size
of the $DISTLIST array
eg..
$ DISTLIST=(ubuntu debian fedora suse)
$ echo ${#DISTLIST[@]}
4
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231029/4aee3b70/attachment.htm>
More information about the User
mailing list