Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16880
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ed Morton <mortonspam@gmail.com> |
| Newsgroups | comp.unix.shell, comp.lang.javascript, comp.lang.python, gnu.emacs.help, comp.emacs |
| Subject | Re: Quickie - Regexp for a string not at the beginning of the line |
| Date | Thu, 25 Oct 2012 21:00:32 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 65 |
| Message-ID | <k6cqs1$efg$1@dont-email.me> (permalink) |
| References | <9eba5652-f814-41fa-83e4-460bca2be264@n16g2000yqi.googlegroups.com> <e6f60702-d85f-4aed-bc03-3147bb007ad8@googlegroups.com> <73f60cf3-d932-4366-a405-6767488560c6@q16g2000yqc.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Fri, 26 Oct 2012 02:00:34 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="8db3055794626b3823aefe741b58e5e5"; logging-data="14832"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fheVBEhymFV7ca9JDb51c" |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 |
| In-Reply-To | <73f60cf3-d932-4366-a405-6767488560c6@q16g2000yqc.googlegroups.com> |
| Cancel-Lock | sha1:ULEd8WVupoBk0u72HlAcIW+4Y5I= |
| Xref | csiph.com comp.unix.shell:6012 comp.lang.javascript:16880 comp.lang.python:32177 comp.emacs:1582 |
Cross-posted to 5 groups.
Show key headers only | View raw
On 10/25/2012 8:08 PM, Rivka Miller wrote:
> On Oct 25, 2:27 pm, Danny <dann90...@gmail.com> wrote:
>> Why you just don't give us the string/input, say a line or two, and what you want off of it, so we can tell better what to suggest
>
> no one has really helped yet.
Because there is no solution - there IS no _RE_ that will match a string not at
the beginning of a line.
Now if you want to know how to extract a string that matches an RE in awk,
that'd be (just one way):
awk 'match($0,/.[$]hello[$]/) { print substr($0,RSTART+1,RLENGTH-1) }'
and other tools would have their ways of producing the same output, but that's
not the question you're asking.
Ed.
>
> I want to search and modify.
>
> I dont wanna be tied to a specific language etc so I just want a
> regexp and as many versions as possible. Maybe I should try in emacs
> and so I am now posting to emacs groups also, although javascript has
> rich set of regexp facilities.
>
> examples
>
> $hello$ should not be selected but
> not hello but all of the $hello$ and $hello$ ... $hello$ each one
> selected
>
> =================
> original post
> =================
>
>
> Hello Programmers,
>
> I am looking for a regexp for a string not at the beginning of the
> line.
>
> For example, I want to find $hello$ that does not occur at the
> beginning of the string, ie all $hello$ that exclude ^$hello$.
>
> In addition, if you have a more difficult problem along the same
> lines, I would appreciate it. For a single character, eg < not at the
> beginning of the line, it is easier, ie
>
> ^[^<]+<
>
> but I cant use the same method for more than one character string as
> permutation is present and probably for more than one occurrence,
> greedy or non-greedy version of [^<]+ would pick first or last but not
> the middle ones, unless I break the line as I go and use the non-
> greedy version of +. I do have the non-greedy version available, but
> what if I didnt?
>
> If you cannot solve the problem completely, just give me a quick
> solution with the first non beginning of the line and I will go from
> there as I need it in a hurry.
>
> Thanks
>
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Quickie - Regexp for a string not at the beginning of the line Rivka Miller <rivkaumiller@gmail.com> - 2012-10-25 13:53 -0700
Re: Quickie - Regexp for a string not at the beginning of the line Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-10-25 23:01 +0200
Re: Quickie - Regexp for a string not at the beginning of the line Danny <dann90038@gmail.com> - 2012-10-25 14:27 -0700
Re: Quickie - Regexp for a string not at the beginning of the line Rivka Miller <rivkaumiller@gmail.com> - 2012-10-25 18:08 -0700
Re: Quickie - Regexp for a string not at the beginning of the line Ed Morton <mortonspam@gmail.com> - 2012-10-25 21:00 -0500
Re: Quickie - Regexp for a string not at the beginning of the line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-26 03:11 +0100
Re: Quickie - Regexp for a string not at the beginning of the line Rivka Miller <rivkaumiller@gmail.com> - 2012-10-25 21:45 -0700
Re: Quickie - Regexp for a string not at the beginning of the line Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-10-26 11:18 +0200
Re: Quickie - Regexp for a string not at the beginning of the line Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-26 13:11 +0100
Re: Quickie - Regexp for a string not at the beginning of the line Ed Morton <mortonspam@gmail.com> - 2012-10-26 07:32 -0500
Re: Quickie - Regexp for a string not at the beginning of the line anon@anon.anon - 2012-10-25 23:22 -0400
Re: Quickie - Regexp for a string not at the beginning of the line Asen Bozhilov <asen.bozhilov@gmail.com> - 2012-10-26 03:46 -0700
csiph-web