ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > FARR Plugins and Aliases

Alias: Google Maps Directions

<< < (3/4) > >>

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!

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:

The following version does the same but is more compact:
^route \s*(.+?)\s*(?:\-?\>)\s*(.+?)\s*$

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*$

^route \s*(.+?)\s*(?:(?:\-?\>)|(?:;))\s*(.+?)\s*$
should do it (but I have not tested it so much).


[0] Message Index

[#] Next page

[*] Previous page

Go to full version