www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Regexp help (possible bug?)

reply gareis <dhasenan gmail.com> writes:
---
import std.regexp;
int main () {
    char[] foo = "foo = bar";

    return 0;
}
---

This outputs "Error: invalid range". According to the documentation, this

not preceded by a backslash.

Adding an octalthorpe doesn't help matters; it produces the same error. Also,
adding the attribute argument doesn't help.

With an example this small, I think this is probably a bug, but I'd like to
check here before submitting a report -- am I doing something wrong?
May 26 2007
parent reply gareis <dhasenan gmail.com> writes:
Argh -- forget that. I forget that regexps require an extra level of escaping;
that should have been:
---

---

This is why I ask now rather than submitting bug reports first.

Thanks!
May 26 2007
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"gareis" <dhasenan gmail.com> wrote in message 
news:f399o6$n1f$1 digitalmars.com...
 Argh -- forget that. I forget that regexps require an extra level of 
 escaping;
 that should have been:
 ---

If you use WYSIWYG strings, you can avoig the ugly double escaping: or I've also never heard of a pound sign being called an "octalthorpe"?
May 26 2007
parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Jarrett Billingsley wrote:
 I've also never heard of a pound sign being called an "octalthorpe"? 
 
http://en.wikipedia.org/wiki/Number_sign -- Remove ".doesnotlike.spam" from the mail address.
May 26 2007
parent reply Don Clugston <dac nospam.com.au> writes:
Deewiant wrote:
 Jarrett Billingsley wrote:
 I've also never heard of a pound sign being called an "octalthorpe"? 
http://en.wikipedia.org/wiki/Number_sign
(BTW, what do you call ₤?)
May 29 2007
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Don Clugston" <dac nospam.com.au> wrote in message 
news:f3grec$uqq$1 digitalmars.com...


 what do you call ??)
Oh I guess that's called a pound sign too, but whenever you say "pound sign" so.
May 29 2007
parent Chris Nicholson-Sauls <ibisbasenji gmail.com> writes:
Jarrett Billingsley wrote:
 "Don Clugston" <dac nospam.com.au> wrote in message 
 news:f3grec$uqq$1 digitalmars.com...

 what do you call ??)
Oh I guess that's called a pound sign too, but whenever you say "pound sign" so.
I've oft heard it called a "Sterling". -- Chris Nicholson-Sauls
May 29 2007
prev sibling parent davidb <ta-nospam-zz gmx.at> writes:
gareis schrieb:
 Argh -- forget that. I forget that regexps require an extra level of escaping;
 that should have been:
 ---

 ---
 
 This is why I ask now rather than submitting bug reports first.
 
 Thanks!
--- --- works as well david
May 26 2007