DonationCoder.com Software > FARR Plugins and Aliases
Alias: Google Maps Directions
herojoker:
Use (?:;) to let $$1 and $$2 contain the two locations.
Perhaps " -> " or ">" (without the "") are a good separators, too?
Here is a relatively robust regex:
^route \s*(.+?)\s*(?:(?:\-\>)|(?:\>))\s*(.+?)\s*$
It matches
route a -> b and route a > b with arbitrary many spaces between route, the first location, the arrow, the second location and the end of the line. Use $$1 and $$2 to access the locations!
lanux128:
thanks herojoker. i'm planning to add Google Maps' search location item in addition to the current 'direction' alias. maybe i'll use your regex to beef up the 'direction' search. :Thmbsup:
herojoker:
The following version does the same but is more compact:
^route \s*(.+?)\s*(?:\-?\>)\s*(.+?)\s*$
lanux128:
hmm.. i was about to go with the one below so that either ->, > or ; can be the separator. so how can i fit this in the compact version?
^route \s*(.+?)\s*(?:(?:\-\>)|(?:\>)|(?:\;))\s*(.+?)\s*$
herojoker:
^route \s*(.+?)\s*(?:(?:\-?\>)|(?:;))\s*(.+?)\s*$
should do it (but I have not tested it so much).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version