grep
From DavinciWiki
(Difference between revisions)
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{DavinciWiki_Function | + | {{DavinciWiki_Function| |
− | [[ | + | Search for the first occurrence of a pattern |
+ | | | ||
+ | Arguments: A text buffer and a string | ||
+ | |||
+ | Return Value: The lines of text containing the string | ||
+ | | | ||
+ | [[Syntax]]: grep(object = TEXT, pattern = STRING) | ||
+ | |||
+ | The grep() function copies each row of the passed TEXT object that contains the specified pattern. grep() supports regex patterns. | ||
+ | | | ||
+ | dv> text | ||
+ | Text Buffer with 3 lines of text | ||
+ | 1: This is a text buffer containing | ||
+ | 2: some information that you want | ||
+ | 3: we will use grep() to find it | ||
+ | |||
+ | dv> aline = grep(text,"information") | ||
+ | Text Buffer with 1 lines of text | ||
+ | 1: some information that you want | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | *[[strstr]] | ||
+ | *[[strsub]] | ||
+ | | | ||
+ | | | ||
+ | }} | ||
[[category:Functions]] | [[category:Functions]] | ||
+ | [[category:Davinci Core]] | ||
[[category:String Functions]] | [[category:String Functions]] |
Latest revision as of 10:44, 27 March 2006
Contents: Description, Arguments, Usage, Examples, Related Functions Supported Under Version: >1.69 Current Davinci Version: 2.27 64-bit Safe: No
Description Search for the first occurrence of a pattern
Arguments and Return Values Arguments: A text buffer and a string Return Value: The lines of text containing the string
Usage Syntax: grep(object = TEXT, pattern = STRING) The grep() function copies each row of the passed TEXT object that contains the specified pattern. grep() supports regex patterns.
Examples dv> text Text Buffer with 3 lines of text 1: This is a text buffer containing 2: some information that you want 3: we will use grep() to find it dv> aline = grep(text,"information") Text Buffer with 1 lines of text 1: some information that you want |
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Recent Core Changes Modified On: 03-27-2006 |