Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2021, 03:00 AM
slouw slouw is offline
Registered User
 
Join Date: Nov 2005
Posts: 166
Word Boundaries for "Phrases and Substrings" Keyword Highlighting

I want a regex keyword expression to cover all names ofr the form PREFIX-<Any_Text_Until_a_space>

These have not worked for me.
Note the inverted commas are not part of the regex.
"PREFIX-.*\b" <---Note \b attempt at a word boundary
"PREFIX-.* " <---Note single space at the end.

Both of the above match the start of the string and rest of the line.


ip distribute-list eigrp ROUTE66 prefix-list PREFIX-LOOPBACK0-ONLY out
ip distribute-list eigrp ROUTE66 prefix-list PREFIX-DEFAULT-ONLY out
ip distribute-list eigrp ROUTE66 prefix-list PREFIX-PNC-ONLY out
ip distribute-list eigrp ROUTE66 prefix-list PREFIX-BLAH-ONLY out
Reply With Quote
  #2  
Old 07-01-2021, 09:35 PM
kdmorse kdmorse is offline
Registered User
 
Join Date: Feb 2018
Posts: 17
Maybe:

"PREFIX-.*?(\s|$)"

1. .* is greedy, that's why it by default is hilighting to the end of the line. The trailing ? makes it stingy.

2. Instead of \s, I used (\s|$) to ensure it matched even if there was no text following the hilighted word. So it fires on PREFIX-* followed by a space, or end of line.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:37 PM.