The dash ( -) represents a non-greedy “zero or more” (i.e. The caret ( ^) and dollar sign ( $) represent “beginning of string” and “end of string”, just like in regexes. Unlike regexes, these characters can only be applied to a single character and not to a whole capture group (i.e. the regex (foo)+ is not possible).Īlternations, represented by the vertical bar ( |) in regexes, are not supported. The asterisk ( *), plus sign ( +) and question mark ( ?) represent “zero or more”, “one or more” and “one or none” of the previous character, just like in regexes. ) represents any character, just like in regexes. The following are some differences and similarities you need to be aware of when using patterns: They are used by many functions in the string library like string.find() and string.match(). Lua has patterns, which fulfill many of the same functions but have a different syntax and some limitations. If you are familiar with regular expressions, you know how powerful they are for examining and manipulating strings in any programming language. hs.distributednotifications), this technique can be useful. This is a matter of taste-I usually prefer to have the full descriptive names (makes the code easier to read), but when dealing with some of the longer module names (e.g. This avoids the console message and has the additional benefit of allowing you to use app (you can use whatever variable you want) instead of typing hs.application in your code. app = require ( 'hs.application' ) > app.get ( "Terminal" ) hs.application : Terminal ( 0圆10000e49118 )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |