regex variable

2013-07-18 Thread shawn wilson
Is there a way of using a variable in a regex? I'm constantly looking for the first octet of IP addresses, so I do: /[^0-9\.]10\. What I've been doing is hitting / and up arrow and then edit but if I could store [^0-9\.] in something easily accessed, that would save some time. -- -- You receiv

Re: regex variable

2013-07-18 Thread Marcin Szamotulski
On 09:42 Thu 18 Jul , shawn wilson wrote: > Is there a way of using a variable in a regex? > > I'm constantly looking for the first octet of IP addresses, so I do: > /[^0-9\.]10\. > > What I've been doing is hitting / and up arrow and then edit but if I > could store [^0-9\.] in something eas

Re: regex variable

2013-07-18 Thread Gautier DI FOLCO
2013/7/18 shawn wilson > Is there a way of using a variable in a regex? > > I'm constantly looking for the first octet of IP addresses, so I do: > /[^0-9\.]10\. > > What I've been doing is hitting / and up arrow and then edit but if I > could store [^0-9\.] in something easily accessed, that woul

Re: regex variable

2013-07-18 Thread shawn wilson
On Thu, Jul 18, 2013 at 9:50 AM, Gautier DI FOLCO wrote: > 2013/7/18 shawn wilson >> What I've been doing is hitting / and up arrow and then edit but if I >> could store [^0-9\.] in something easily accessed, that would save >> some time. > > > for example: > :%s/\([^0-9\.]\)10\./\1/g > Uh, I

Re: regex variable

2013-07-18 Thread shawn wilson
Sweet, didn't know about C+r - that works. I'll look more into the leader stuff (which'll probably work better) later. Thanks On Thu, Jul 18, 2013 at 9:55 AM, Marcin Szamotulski wrote: > On 09:42 Thu 18 Jul , shawn wilson wrote: >> Is there a way of using a variable in a regex? >> >> I'm cons

Re: regex variable

2013-07-18 Thread Marcin Szamotulski
On 10:06 Thu 18 Jul , shawn wilson wrote: > Sweet, didn't know about C+r - that works. I'll look more into the > leader stuff (which'll probably work better) later. Thanks > > -- > > -- > > You received this message from the "vim_use" maillist. > > Do not top-post! Type your reply below the tex

Re: regex variable

2013-07-18 Thread Bee
On Thursday, July 18, 2013 6:42:06 AM UTC-7, shawn wilson wrote: > Is there a way of using a variable in a regex? > > > > I'm constantly looking for the first octet of IP addresses, so I do: > > /[^0-9\.]10\. > > > > What I've been doing is hitting / and up arrow and then edit but if I > >

Re: regex variable

2013-07-18 Thread Lech Lorens
On Thursday, July 18, 2013 3:42:06 PM UTC+2, shawn wilson wrote: > Is there a way of using a variable in a regex? > > I'm constantly looking for the first octet of IP addresses, so I do: > /[^0-9\.]10\. > > > > What I've been doing is hitting / and up arrow and then edit but if I > could store

Re: regex variable

2013-07-18 Thread Ben Fritz
On Thursday, July 18, 2013 3:51:01 PM UTC-5, Lech Lorens wrote: > On Thursday, July 18, 2013 3:42:06 PM UTC+2, shawn wilson wrote: > > > > I'm constantly looking for the first octet of IP addresses, so I do: > > /[^0-9\.]10\. > > > > Slightly off-topic, but wanted to make you aware that [^\.] ma

Re: regex variable

2013-07-18 Thread shawn wilson
On Jul 18, 2013 5:54 PM, "Ben Fritz" wrote: > > On Thursday, July 18, 2013 3:51:01 PM UTC-5, Lech Lorens wrote: > > On Thursday, July 18, 2013 3:42:06 PM UTC+2, shawn wilson wrote: > > > > > > I'm constantly looking for the first octet of IP addresses, so I do: > > > /[^0-9\.]10\. > > > > > > > Sl

Re: regex variable

2013-07-18 Thread Tony Mechelynck
On 07/19/13 03:34, shawn wilson wrote: On Jul 18, 2013 5:54 PM, "Ben Fritz" mailto:fritzophre...@gmail.com>> wrote: > > On Thursday, July 18, 2013 3:51:01 PM UTC-5, Lech Lorens wrote: > > On Thursday, July 18, 2013 3:42:06 PM UTC+2, shawn wilson wrote: > > > > > > I'm constantly looking for

RE: regex variable

2013-07-18 Thread John Beckett
shawn wilson wrote: > This is probably a feature request but I really do hate the > regex engine and would love to swap it out. Is there / can > there be a compile time option to use a different engine? No (I assume you want different regex syntax, probably PCRE). Tony's post is talking about a n

RE: regex variable

2013-07-19 Thread shawn wilson
On Jul 18, 2013 11:48 PM, "John Beckett" wrote: > > shawn wilson wrote: > > This is probably a feature request but I really do hate the > > regex engine and would love to swap it out. Is there / can > > there be a compile time option to use a different engine? > > No (I assume you want different r

RE: regex variable

2013-07-19 Thread John Beckett
shawn wilson wrote: > libpcre would be fine, yes. Or the library that Ruby uses - > either way. > ... > I guess this should be a feature request then? Vim is strongly attached to compatibility, and is immensely complex. I would not bother requesting a new regex syntax because it won't happen. Joh

Re: regex variable

2013-07-19 Thread BPJ
2013-07-19 09:59, shawn wilson skrev: On Jul 18, 2013 11:48 PM, "John Beckett" wrote: shawn wilson wrote: This is probably a feature request but I really do hate the regex engine and would love to swap it out. Is there / can there be a compile time option to use a different engine? No (I as

Re: regex variable

2013-07-19 Thread Nikolay Pavlov
On Jul 19, 2013 5:49 PM, "BPJ" wrote: > > 2013-07-19 09:59, shawn wilson skrev: > >> On Jul 18, 2013 11:48 PM, "John Beckett" wrote: >>> >>> >>> shawn wilson wrote: This is probably a feature request but I really do hate the regex engine and would love to swap it out. Is there / ca

Re: regex variable

2013-07-19 Thread Ben Fritz
On Friday, July 19, 2013 8:49:34 AM UTC-5, BPJ wrote: > 2013-07-19 09:59, shawn wilson skrev: > > > On Jul 18, 2013 11:48 PM, "John Beckett" wrote: > > >> > > >> shawn wilson wrote: > > >>> This is probably a feature request but I really do hate the > > >>> regex engine and would love to swap

Re: regex variable

2013-07-19 Thread BPJ
2013-07-19 16:02, Ben Fritz skrev: For searching it's not possible to use a different syntax, but you can easily do it for substitution via :perldo, :rubydo, :luado, etc. That is, if you have your Vim compiled with support for your language of choice. I actually prefer :!perl ... since that w

Re: regex variable

2013-07-19 Thread BPJ
2013-07-19 16:00, Nikolay Pavlov skrev: On Jul 19, 2013 5:49 PM, "BPJ" wrote: 2013-07-19 09:59, shawn wilson skrev: On Jul 18, 2013 11:48 PM, "John Beckett" wrote: shawn wilson wrote: This is probably a feature request but I really do hate the regex engine and would love to swap it out

Re: regex variable

2013-07-19 Thread shawn wilson
Just to be clear, I mentioned Ruby because don't like libpcre as much and haven't used ruby enough for Oniguruma (http://www.geocities.jp/kosako3/oniguruma/) to piss me off and afaik, there would be no detatching perl's regex engine from perl. So it was more of a comment of "I know these exist, wou

Re: regex variable

2013-07-19 Thread Nikolay Pavlov
On Jul 19, 2013 6:37 PM, "BPJ" wrote: > > 2013-07-19 16:00, Nikolay Pavlov skrev: > >> On Jul 19, 2013 5:49 PM, "BPJ" wrote: >>> >>> >>> 2013-07-19 09:59, shawn wilson skrev: >>> On Jul 18, 2013 11:48 PM, "John Beckett" wrote: > > > > shawn wilson wrote: >> >> >>

Re: regex variable

2013-07-19 Thread BPJ
2013-07-19 17:40, Nikolay Pavlov skrev: You missed the point of locales. It is not about encoding, it is about language and affects ranges (what characters match a-z range depends on language you set in your locale) and a big bunch of other things I do not care about. I know, but I usually deal

Vim's regex engine. [Was: regex variable]

2013-07-19 Thread Erik Christiansen
On 18.07.13 21:34, shawn wilson wrote: > This is probably a feature request but I really do hate the regex engine > and would love to swap it out. Is there / can there be a compile time > option to use a different engine? Granted, vim's obscurely parochial regex engine has for many years been the