Arbortext Command Language > Functions by Alphabetical Listing > looking_at
  
looking_at
looking_at (regexp[, doc])
This function returns 1 (True) if the text following the cursor matches the regular expression regexp. The regular expression is compiled with tag scanning enabled (that is, as if set tagscan=on). Thus, looking_at("</title>") returns 1 (True) if the cursor is positioned before an end title tag.
* 
Even if you have applied an alias map to the document, regexp cannot include aliases.
The doc argument specifies the identifier of the document tree to query. If omitted or 0, the current document is used.
Because double quoted strings in expressions get interpreted for backslash escape sequences when the command is parsed, if you wish for a character not to be interpreted as a regular expression meta character, you must double the \. For example, to match the literal character <, you would specify:
looking_at(“\\<”)
Alternatively, single quotes may be used to suppress backslash interpretation, making the following statement equivalent to the previous one.
looking_at('\<')
The set case option determines whether the case of letters is significant when performing the match. For example, if set case=off, then
looking_at("[aB]")
would match A or b as well as a or B.
Related Topics
set case command
Using regular expressions