|
aslanthekat Novice
Joined: 17 Sep 2007 Posts: 44 Location: Missouri
|
Posted: Wed Jul 25, 2012 3:46 pm
Pattern Matching: Not at beginning of a line |
Hey all,
Is there a way to make a trigger fire similar to matching at the beginning of a line, but match only if its NOT at the beginning of a line? Same thing for end of line.[/code] |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Jul 25, 2012 4:03 pm |
There's no patternmatching construct for it, but you can test for this using %begins() and %ends().
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jul 25, 2012 5:34 pm |
You could do it with a regex trigger, like so:
Code: |
#REGEX {.+YOURPATTERNHERE.+} {YOURCODEHERE} |
In a regular expression "." is a wildcard for any character, and "+" means at least one instance of the preceding pattern. So .+ means "at least one character". Putting that before your pattern guarantees that your pattern will not match the start of the line, and similarly for putting it after your pattern.
[edit]Note that if you used wildcards or other expressions in your pattern, you will have to translate those to regular expressions, too. See the help under #REGEX. |
|
|
|
|
|