473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

String replace alternative

Is there a possibility to do a string replace in javascript without regular
experessions. It feels like using a hammer to crash an egg.

Wim
Jul 23 '05 #1
24 4455
Wim Roffal wrote:
Is there a possibility to do a string replace in javascript without regular
experessions. It feels like using a hammer to crash an egg.

Wim


Compare:

str = str.replace(/_/g, " ");

with:

var result = [];
for (var i = 0; i < str.length; i++) {
if (str.charAt(i) == "_") {
result.push(" ");
}else {
result.push(str.charAt(i));
}
}
str = result.join('');

And this was a simple example. Anything beyond a single character replacement
and it gets much more difficult, involving keeping track of substrings indices,
etc. String#replace() already does all this for you.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #2
Grant Wagner <gw*****@agricoreunited.com> wrote in
news:41***************@agricoreunited.com:
Is there a possibility to do a string replace in javascript without
regular experessions. It feels like using a hammer to crash an egg.

Wim


Compare:

str = str.replace(/_/g, " ");

with:

var result = [];
for (var i = 0; i < str.length; i++) {
if (str.charAt(i) == "_") {
result.push(" ");
}else {
result.push(str.charAt(i));
}
}
str = result.join('');

And this was a simple example. Anything beyond a single character
replacement and it gets much more difficult, involving keeping track
of substrings indices, etc. String#replace() already does all this for
you.


Alternatively, if you don't feel the urge to over-complicate the issue,
this does the same thing rather more easily:

str = str.split("_").join(" ");

However, the replace method is still easier in most cases. If you do want
to avoid regular expressions (and avoiding unnecessary regexes is a worthy
objective), then you can always do:

String.prototype.replacestring = function(from, to) {
return this.split(from).join(to);
}

str = str.replacestring("_", " ");
Jul 23 '05 #3
Lee
Duncan Booth said:
However, the replace method is still easier in most cases. If you do want
to avoid regular expressions (and avoiding unnecessary regexes is a worthy
objective), then you can always do:

String.prototype.replacestring = function(from, to) {
return this.split(from).join(to);
}

str = str.replacestring("_", " ");


However, split() takes a regular expression as the first
argument, so I don't think there's any real advantage
to using it over replace().

Jul 23 '05 #4
Lee <RE**************@cox.net> wrote in
news:ce*********@drn.newsguy.com:
Duncan Booth said:
However, the replace method is still easier in most cases. If you do
want to avoid regular expressions (and avoiding unnecessary regexes is
a worthy objective), then you can always do:

String.prototype.replacestring = function(from, to) {
return this.split(from).join(to);
}

str = str.replacestring("_", " ");


However, split() takes a regular expression as the first
argument, so I don't think there's any real advantage
to using it over replace().


split() can take either a string or a regular expression as the first
argument.

One advantage is that you don't have to worry about escaping the string
whereas with the replace method you do.

If the 'from' string is input from the user, and you don't want it treated
as a regular expression but as a simple string, then creating a regular
expression from the string requires extra work.

In other words consider:

str = str.replacestring("+", "-");
str = str.replacestring("[", "(");
str = str.replacestring(userinput1, userinput2);

and the equivalent expressions using replace:

str = str.replace(/\+/g, "-");
str = str.replace(/\[/g, "(");
str = str.replace(???);

(I'm not saying that there isn't an easy way to do the last one, there
probably is, but my Javascript isn't that great and I can't think of one.
In Python I would use re.escape, but then Python can do string based
substitutions as well as regex based ones so I wouldn't have to.)

Note that the replace method does actually act as though it accepts a
string, so long as you don't want any flags. This works, although it only
does one replace:

str = str.replace("+", "-")
Jul 23 '05 #5
JRS: In article <ce**********@reader11.wxs.nl>, dated Fri, 30 Jul 2004
20:29:14, seen in news:comp.lang.javascript, Wim Roffal
<wi*************@nospamm-planet.nl> posted :
Is there a possibility to do a string replace in javascript without regular
experessions.


Yes : consider & test :- s = "abcde".replace("c", "CCC")

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6
Duncan Booth wrote:
Lee <RE**************@cox.net> wrote [...]
Duncan Booth said:
However, the replace method is still easier in most cases. If you do
want to avoid regular expressions (and avoiding unnecessary regexes is
a worthy objective), then you can always do:

String.prototype.replacestring = function(from, to) {
return this.split(from).join(to);
}

str = str.replacestring("_", " ");

[...]


In other words consider:

str = str.replacestring("+", "-");
str = str.replacestring("[", "(");
str = str.replacestring(userinput1, userinput2);

and the equivalent expressions using replace:

str = str.replace(/\+/g, "-");
str = str.replace(/\[/g, "(");
str = str.replace(???);

(I'm not saying that there isn't an easy way to do the last one, there
probably is, but my Javascript isn't that great and I can't think of one.
In Python I would use re.escape, but then Python can do string based
substitutions as well as regex based ones so I wouldn't have to.)


If, and only if, the user should not be allowed to enter regular
expressions, you are required to escape all special characters in
`userinput1' using String.prototype.replace before you can apply
it on String.prototype.replace() to replace itself. Quick hack:

String.prototype.escapeRE = function(s)
{
return s.replace(/[]\\^$*+?.():=!|{,}[]/g, "\\$1");
}

var str = ...;
...
str = str.replace(userinput1.escapeRE(), userinput2);

BTW: ECMAScript/J(ava)Script can do string based substitutions as well --
just pass a string as first argument; but then you only get the first
occurrence of it replaced.
PointedEars

P.S.
me@privacy net is not an e-mail address ("A mailbox receives mail.") and
thus using it violates Netiquette (RFC 1855) and Internet/Usenet standards
(RFC 1036, 2822 among others) as well as most certainly the Acceptable Use
Policy of your Internet/Usenet service provider. Those who have told you
that using me@privacy.net does no harm to anyone but spammers have been
lying. <http://www.interhack.net/pubs/munging-harmful/>
Jul 23 '05 #7
Thomas 'PointedEars' Lahn wrote:
String.prototype.escapeRE = function(s)
{
return s.replace(/[]\\^$*+?.():=!|{,}[]/g, "\\$1");
}

var str = ...;
...
str = str.replace(userinput1.escapeRE(), userinput2);

BTW: ECMAScript/J(ava)Script can do string based substitutions as well --
just pass a string as first argument; but then you only get the first
occurrence of it replaced.


Because of the latter, one must use a RegExp object as first argument:

var str = ...;
...
str = str.replace(new RegExp(userinput1.escapeRE(), "g"), userinput2);
PointedEars
Jul 23 '05 #8
Thomas 'PointedEars' Lahn wrote:

Because of the latter, one must use a RegExp object as first argument:

var str = ...;
...
str = str.replace(new RegExp(userinput1.escapeRE(), "g"), userinput2);
As with most user input, this could be problematic. Escaped characters
may throw a spanner in the works.
eval() may be used, though:

S.replace(eval("/"+userinput+"/g"), userinput2);
Mick
PointedEars

Jul 23 '05 #9
Mick White <mw******@BOGUSrochester.rr.com> writes:
Thomas 'PointedEars' Lahn wrote:
str = str.replace(new RegExp(userinput1.escapeRE(), "g"), userinput2);


As with most user input, this could be problematic. Escaped characters
may throw a spanner in the works.


I assume the call to "escapeRE" is meant to convert a string into a regular
expression that matches that string. It will *add* escape, so that the resulting
string is a valid RegExp that matches userinput1.
eval() may be used, though:
.... but shouldn't. Using eval("/"+string+"/g") is at best equivalent
to RegExp(string,"g") if string is a valid RegExp, but can fail in much more spectacular
ways if string is not a RegExp. What if string was "x/;window.close();//" ?
S.replace(eval("/"+userinput+"/g"), userinput2);


That is much less likely to work. It will fail for as simple a string as "["
as userinput.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #10
Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> wrote in
news:41**************@PointedEars.de:
BTW: ECMAScript/J(ava)Script can do string based substitutions as well
-- just pass a string as first argument; but then you only get the
first occurrence of it replaced.
Funny, thats exactly what I said in one of the paragraphs that you trimmed
from my posting.
P.S.
me@privacy net is not an e-mail address ("A mailbox receives mail.")
and thus using it violates Netiquette (RFC 1855) and Internet/Usenet
standards (RFC 1036, 2822 among others) as well as most certainly the
Acceptable Use Policy of your Internet/Usenet service provider. Those
who have told you that using me@privacy.net does no harm to anyone but
spammers have been lying.
<http://www.interhack.net/pubs/munging-harmful/>


me@privacy.net is a genuine e-email address which receives email that
nobody reads (although it does send a reply when it receives email). I use
it specifically because my Usenet service provider requires a valid email
address and suggests the use of me@privacy.net as a suitable valid address
where permission has been given to use it for this purpose.

Anyone trying to reply by email to my postings (using conforming software)
will, of course, have sent the reply to the reply-to address which will
reach me.

The document to which you refer list a variety of reasons why munging is
harmful. I agree with almost all of them: spammers do not see bounces (do I
care?); violating standards (which thankfully I'm not doing); more hassle
for innocent third parties (just as well the third party has given their
consent then); additional hassle for me (none); there is no silver bullet
(yup).

Jul 23 '05 #11
Duncan Booth wrote:
Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> wrote in
news:41**************@PointedEars.de:
BTW: ECMAScript/J(ava)Script can do string based substitutions as well
-- just pass a string as first argument; but then you only get the
first occurrence of it replaced.


Funny, thats exactly what I said in one of the paragraphs that you
trimmed from my posting.


Well, not exactly.
P.S.
me@privacy net is not an e-mail address ("A mailbox receives mail.")
and thus using it violates Netiquette (RFC 1855) and Internet/Usenet
standards (RFC 1036, 2822 among others) as well as most certainly the
Acceptable Use Policy of your Internet/Usenet service provider. Those
who have told you that using me@privacy.net does no harm to anyone but
spammers have been lying.
<http://www.interhack.net/pubs/munging-harmful/>


me@privacy.net is a genuine e-email address which receives email that
nobody reads (although it does send a reply when it receives email).


No, the RFCs state it plain and simple: "A mailbox receives mail."
(RFC 2822, 3.4. Address Specification) and "The 'From' line contains
the electronic mailing address of the person who sent the message,
in the Internet syntax." (RFC 1036, 2.1.1 From). me@privacy.net
receives nothing as there is no mail exchanger (MX record) configured
for the domain (and its subdomains, if it had any) and for the A record,
no SMTP server installed:

--------------------------------------------------------------------------
$ chkmadd -v me@privacy.net -t 120
chkmadd 0.1.2.2004062116 -- (C) 2003, 2004 Thomas Lahn <me**@PointedEars.de>
Distributed under the terms of the GNU General Public License (GPL).
See COPYING file or <http://www.fsf.org/copyleft/gpl.html> for details.
Report bugs to <ch*****@PointedEars.de>.

E-mail address(es) to check:
me@privacy.net

Using a 120 second(s) timeout.

Verifying <me@privacy.net> ...
Mail exchanger(s) for privacy.net:
None. Trying A record ...
privacy.net has address 66.98.244.52

chkmadd.exp 0.1.1.2004072917 -- (C) 2004 Thomas Lahn <me**@PointedEars.de>
Distributed under the terms of the GNU General Public License (GPL).
See COPYING file or <http://www.fsf.org/copyleft/gpl.html> for details.
Report bugs to <ch*********@PointedEars.de>.

spawn telnet -- 66.98.244.52 smtp
Trying 66.98.244.52...
telnet: Unable to connect to remote host: Connection timed out
--------------------------------------------------------------------------

So me@privacy.net does *not* name a mailbox, it cannot.[1] Apart from that,
it does *not* belong to anyone. So it is therefore *no e-mail address* (to
be used in standards compliant headers).

I had this argument several times before (and -- isn't it characteristic? --
about the same reaction, although I must admit that yours appear to be the
most positive one), nuff said. However, consider yourself killfiled then
(as with my software I can only filter on the From and there are more people
abusing me@privacy.net who do not care for Reply-To.)
PointedEars
___________
[1] There were times were me@privacy.net returned a bounce that accused
the receiver of it to be a spammer and informed him/her that therefore
his/her mails were not read. It was a mailbox these times, yet a
asocial configured one. It was still bad as the mailbox did not belong
to anyone. Then they dropped this practice and removed the MX record
and the SMTP server as well, making it all worse (as described above).
Unfortunately, they are now lying about the bounce a receiver would
get on <http://privacy.net/email/>. There is no bounce from
privacy.net, it cannot be, as long there is no SMTP server. Instead
either the bounce is generated by the sending mail exchanger or the
e-mail cannot be even submitted (as the sending MX checks the receivers
"address" before, like my program does, and rejects it for the reasons
given).
Jul 23 '05 #12
[posted and mailed]

Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> wrote in
news:41**************@PointedEars.de:
P.S.
me@privacy net is not an e-mail address ("A mailbox receives mail.")
and thus using it violates Netiquette (RFC 1855) and Internet/Usenet
standards (RFC 1036, 2822 among others) as well as most certainly the
Acceptable Use Policy of your Internet/Usenet service provider. Those
who have told you that using me@privacy.net does no harm to anyone but
spammers have been lying.
<http://www.interhack.net/pubs/munging-harmful/>


me@privacy.net is a genuine e-email address which receives email that
nobody reads (although it does send a reply when it receives email).


No, the RFCs state it plain and simple: "A mailbox receives mail."
(RFC 2822, 3.4. Address Specification) and "The 'From' line contains
the electronic mailing address of the person who sent the message,
in the Internet syntax." (RFC 1036, 2.1.1 From). me@privacy.net
receives nothing as there is no mail exchanger (MX record) configured
for the domain (and its subdomains, if it had any) and for the A record,
no SMTP server installed


Thats interesting. Sorry, I just went by what their web page claimed for
the address, I didn't check that it actually did what it claimed.

I've changed the From header line on my posting to use an address in the
..invalid domain. Feel free to send me chapter and verse on how this still
violates lots of RFCs (I can't see anything in RFC1855 that either .invalid
or me@privacy.net violates, and RFC 1036 doesn't actually say that the From
address must be valid), but at least you now have the option to killfile me
explicitly.

If you think the newsgroup has had enough of this thread, feel free to
email me directly, or not as you please.
Jul 23 '05 #13
Duncan Booth <du**********@invalid.invalid> wrote in reply to Thomas
'PointedEars' Lahn in news:Xn***************************@127.0.0.1:
[posted and mailed]

Except that Pointed Ears reply-to address bounced, so the mailed copy
didn't get through. :-)

Jul 23 '05 #14
JRS: In article <Xn***************************@127.0.0.1>, dated Mon, 2
Aug 2004 09:26:59, seen in news:comp.lang.javascript, Duncan Booth
<du**********@invalid.invalid> posted :
Duncan Booth <du**********@invalid.invalid> wrote in reply to Thomas
'PointedEars' Lahn in news:Xn***************************@127.0.0.1:
[posted and mailed]

That is generally considered to be ill-mannered, although substantially
less so when clearly marked as such.

Except that Pointed Ears reply-to address bounced, so the mailed copy
didn't get through. :-)

Disregard all that he says about the composition of news articles. He
relies on some German document - such may be applicable by local consent
to the German hierarchy, but in this Big8 newsgroup only international
documents such as RFCs and Usefor drafts are of any value.

He remands me rather of Magdeburg.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #15
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:PQ**************@merlyn.demon.co.uk:
JRS: In article <Xn***************************@127.0.0.1>, dated Mon, 2
Aug 2004 09:26:59, seen in news:comp.lang.javascript, Duncan Booth
<du**********@invalid.invalid> posted :
Duncan Booth <du**********@invalid.invalid> wrote in reply to Thomas
'PointedEars' Lahn in news:Xn***************************@127.0.0.1:
[posted and mailed]


That is generally considered to be ill-mannered, although substantially
less so when clearly marked as such.


When someone indicates that they have just killfiled me (as he did), and I
think I can make a constructive contribution, then I feel perfectly
justified in sending him an emailed copy.

Actually, when I had sent it, I realised that the email copy was a bit
pointless (ignoring for a moment the fact that it bounced because his
mailbox was full). Since I had just changed the From line in my postings,
it seems likely that any killfile he did set up wouldn't actually have been
effective for that message. Oh well, you can't win them all. :-)

Jul 23 '05 #16
Duncan Booth wrote:
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:PQ**************@merlyn.demon.co.uk:
Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>
as referred to by the FAQ of this newsgroup
<http://www.jibbering.com/faq/faq_notes/pots1.htm>
(see "Additional Reading") and
<FAQENTRY>
<http://www.allmyfaqs.com/faq.pl?How_to_post>
</FAQENTRY>
[...] Duncan Booth [...] posted :
Duncan Booth [...] wrote [...]:
[posted and mailed]


That is generally considered to be ill-mannered, although substantially
less so when clearly marked as such.


When someone indicates that they have just killfiled me (as he did), and I
think I can make a constructive contribution, then I feel perfectly
justified in sending him an emailed copy.


Well, that would depend on the reason of killfiling. In this case, I
would consider it OK.
Actually, when I had sent it, I realised that the email copy was a bit
pointless (ignoring for a moment the fact that it bounced because his
mailbox was full).
I'm sorry, the mailbox was full because of spam, a condition that is likely
to change soon as I am going to move to another web hosting service which
will also take care of my mailbox which will allow me to filter spam much
more effectively than now, installing server-side filter software (as it
happens that I have official root access to the server in question :)).
Since I had just changed the From line in my postings,
To something even more invalid. RFCs state that the .invalid TLD should
be used for DNS test purposes only which is why I have just added it to
the filter rules concerning intensive address munging.
it seems likely that any killfile he did set up wouldn't actually have
been effective for that message.
If I killfile someone in Usenet, I will still read his/her mails (e.g.
allowing him/her to apologize). And with my new newsreader (KNode), I
can still read his followups to my postings, depending on the level of
noise/annoyance.
Oh well, you can't win them all. :-)


But sometimes you are lucky.
HTH

PointedEars
Jul 23 '05 #17
Duncan Booth wrote:
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:PQ**************@merlyn.demon.co.uk:
Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>
as referred to by the FAQ of this newsgroup
<http://www.jibbering.com/faq/faq_notes/pots1.html> [1]
(see "Additional Reading") and
<FAQENTRY>
<http://www.allmyfaqs.com/faq.pl?How_to_post>
</FAQENTRY>

[1] There is a typo in the original filename, isn't it?
[...] Duncan Booth [...] posted :
Duncan Booth [...] wrote [...]:
[posted and mailed]


That is generally considered to be ill-mannered, although substantially
less so when clearly marked as such.


When someone indicates that they have just killfiled me (as he did), and I
think I can make a constructive contribution, then I feel perfectly
justified in sending him an emailed copy.


Well, that would depend on the reason of killfiling. In this case, I
would consider it OK.
Actually, when I had sent it, I realised that the email copy was a bit
pointless (ignoring for a moment the fact that it bounced because his
mailbox was full).
I'm sorry, the mailbox was full because of spam, a condition that is likely
to change soon as I am going to move to another web hosting service which
will also take care of my mailbox which will allow me to filter spam much
more effectively than now, installing server-side filter software (as it
happens that I have official root access to the server in question :)).
Since I had just changed the From line in my postings,
To something even more invalid. RFCs state that the .invalid TLD should
be used for DNS test purposes only which is why I have just added it to
the filter rules concerning intensive address munging.
it seems likely that any killfile he did set up wouldn't actually have
been effective for that message.
If I killfile someone in Usenet, I will still read his/her mails (e.g.
allowing him/her to apologize). And with my new newsreader (KNode), I
can still read his followups to my postings, depending on the level of
noise/annoyance.
Oh well, you can't win them all. :-)


But sometimes you are lucky.
HTH

PointedEars
Jul 23 '05 #18
JRS: In article <19*****************@PointedEars.de>, dated Sat, 7 Aug
2004 01:19:11, seen in news:comp.lang.javascript, the thoroughly
objectionable Thomas 'PointedEars' Lahn <Po*********@web.de> posted :
Duncan Booth wrote:
Dr John Stockton <sp**@merlyn.demon.co.uk> wrote in
news:PQ**************@merlyn.demon.co.uk:


Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>


You are behind the times. You refer to an old document, and one which
has no rightful authority.
Read instead
http://www.ietf.org/internet-drafts/...-useage-00.txt
http://www.ietf.org/internet-drafts/...article-13.txt
which represent current thinking among experiences users.

Its minimum recommendation exceeds what you demand; and a full
attribution is regarded in it as wholly acceptable. Just because you,
in your limited experience, find no need for more than the personal name
is no reason for trying to stop others from providing information which
they know, in their more diverse experience, to be variously useful to
themselves and to others.
You behave in a better-mannered fashion in de.comp.lang.javascript - or
have you already hectored them into following what you dictate? - or do
you not want to make a fool of yourself in front of what are mainly your
own people?

You are also a hypocrite - you demand shortness, yet you inflict on is,
in the middle of your proper appellation "Thomas Lahn" a description of
your irrelevant physical peculiarities.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #19
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Duncan Booth wrote:
Dr John Stockton [...] wrote [...]: Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>


You are behind the times. You refer to an old document, and one which
has no rightful authority.


It is referred to by the FAQ of this newsgroup, that is enough authority,
if common sense ever required such.
Read instead
http://www.ietf.org/internet-drafts/...-useage-00.txt
http://www.ietf.org/internet-drafts/...article-13.txt
which represent current thinking among experiences users.


Nonsense.

Both are merely Internet Drafts published by *one* user which are still
(five months after they have been published and three months before they
will automatically expire) heavily under discussion on the USEFOR mailing
list.

You may want to get informed about how Internet Drafts must and must not
be referred to. The section "Status of this Memo" would be helpful in
both cases.
PointedEars
Jul 23 '05 #20
JRS: In article <24****************@PointedEars.de>, dated Sun, 8 Aug
2004 01:42:11, seen in news:comp.lang.javascript, Thomas 'superfluous
information about physical peculiarities' Lahn <Po*********@web.de>
posted :
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Duncan Booth wrote:
Dr John Stockton [...] wrote [...]:
Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>
You are behind the times. You refer to an old document, and one which
has no rightful authority.


It is referred to by the FAQ of this newsgroup, that is enough authority,
if common sense ever required such.


Common sense is something that you evidently do not possess, because you
persist in your bullying attitude in spite of repeated requests from
regular users of this group.

The FAQ does not refer to netmeister, nor to any page called
learn2quote.

Read instead
http://www.ietf.org/internet-drafts/...-useage-00.txt
http://www.ietf.org/internet-drafts/...article-13.txt
which represent current thinking among experiences users.


Nonsense.

Both are merely Internet Drafts published by *one* user which are still
(five months after they have been published and three months before they
will automatically expire) heavily under discussion on the USEFOR mailing
list.


The articles have, of practical necessity, a single editor; but they are
collective works contributed to by a group of people including many
well-known names in the industry.

The editor, in particular, is a person whose integrity is assured; the
drafts will represent opinions currently held in the Internet
Engineering Task Force.

This is far better guidance for present-day news than some translation
of an ancient and unauthoritative article.

You may want to get informed about how Internet Drafts must and must not
be referred to. The section "Status of this Memo" would be helpful in
both cases.


They are to be cited as work in progress; my reference is not a formal
citation, and describes them in substantially similar terms.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #21
Dr John Stockton wrote:
Thomas [...] Lahn [...] posted :
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Duncan Booth wrote:
> Dr John Stockton [...] wrote [...]:
Please do not write attribution novels, see
<http://www.netmeister.org/news/learn2quote.html>

You are behind the times. You refer to an old document, and one which
has no rightful authority.


It is referred to by the FAQ of this newsgroup, that is enough authority,
if common sense ever required such.


[...]
The FAQ does not refer to netmeister, nor to any page called
learn2quote.


<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1AddR>
PointedEars
Jul 23 '05 #22
Thomas 'PointedEars' Lahn wrote:
Dr John Stockton wrote:

Thomas [...] Lahn [...] posted :
Dr John Stockton wrote:

<--snip-->
[...]
The FAQ does not refer to netmeister, nor to any page called
learn2quote.

<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1AddR>


The page it refers to is learn2quote2.html though, note the additional
2, which is a sub-section of the entire site, not the page you
referenced (learn2quote.html)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #23
JRS: In article <43*****************@PointedEars.de>, dated Mon, 9 Aug
2004 05:29:16, seen in news:comp.lang.javascript, the tiresome Thomas
'Pin-Brain' Lahn <Po*********@web.de> posted :
Dr John Stockton wrote:
Thomas [...] Lahn [...] posted :
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
> Duncan Booth wrote:
>> Dr John Stockton [...] wrote [...]:
> Please do not write attribution novels, see
> <http://www.netmeister.org/news/learn2quote.html>

You are behind the times. You refer to an old document, and one which
has no rightful authority.

It is referred to by the FAQ of this newsgroup, that is enough authority,
if common sense ever required such.


[...]
The FAQ does not refer to netmeister, nor to any page called
learn2quote.


<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1AddR>


That is not the FAQ; you are an incompetent citer.

The FAQ is posted here regularly, and it may be presumed to have been
reviewed by all regulars who care. The Notes are not so posted, and are
the work of a competent, but not infallible, individual.

A document cited so indirectly is probably worth reading, but cannot be
taken as being authoritative.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 23 '05 #24
Dr John Stockton wrote:
JRS: In article <43*****************@PointedEars.de>, dated Mon, 9 Aug
2004 05:29:16, seen in news:comp.lang.javascript, the tiresome Thomas
'Pin-Brain' Lahn <Po*********@web.de> posted :


Your "style" of discussion is quite ... interesting. As in the
old Chinese curse saying "May you live in more interesting times."
Dr John Stockton wrote:
Thomas [...] Lahn [...] posted :
Dr John Stockton wrote:
> [...] Thomas 'PointedEars' Lahn [...] posted :
>> Duncan Booth wrote:
>>> Dr John Stockton [...] wrote [...]:
>> Please do not write attribution novels, see
>> <http://www.netmeister.org/news/learn2quote.html>
>
> You are behind the times. You refer to an old document, and one which
> has no rightful authority.

It is referred to by the FAQ of this newsgroup, that is enough
authority, if common sense ever required such.

[...]
The FAQ does not refer to netmeister, nor to any page called
learn2quote.


<http://www.jibbering.com/faq/faq_notes/pots1.html#ps1AddR>


That is not the FAQ; you are an incompetent citer.


Well, it is not exactly the FAQ. It is part of the FAQ Notes, hosted
at the same Web site and most certainly maintained by the same people
(interestingly, among them one who debates that this even an issue),
which is referred to by the FAQ at the beginning of its section 2.3.
A document does not exist out of context, neither the FAQ Notes do
nor does the document referred to by them under Additional Reading
at position 3 of 8 (not so unimportant, eh?).

Instead of calling me incompetent you should simply admit that you have
overlooked it. And now EOD for me since I doubt your seemingly built-in
arrogance module will allow you to do the former.
PointedEars
Jul 23 '05 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not...
12
by: Zoury | last post by:
Hi there! :O) I need to replace all the accentued character of a string by it's non-accentued-character equivalent. 1. is there a way to do so without iterating trought the entire string and...
4
by: Tom | last post by:
I have string that is 2.5 million bytes long. I tried using Regular Expressions to look for patterns and replace the pattern found with a pre-defined text. This works great on some computers...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
2
by: Joebloggs | last post by:
Hi I am trying to do an ldap lookup. I can pick up the domain name in the standard format DOMAIN\USERNAME. The problem is the company I work for expects the query in the format DOMAIN:USERNAME....
4
by: Derek Martin | last post by:
I have an object with several string elements that I would like to check for invalid characters in the properties of each element. Can I use string.replace to do that or is there a better...
37
by: Xiao Jianfeng | last post by:
Hi, I need to print a long sting, which is two long so it must expand two lines. I know that we can use backslash(\) to explicitly join two lines into a logical line, but this doesn't work for...
4
by: gamehack | last post by:
Hi all, I've been designing a program which would need to have a function to replace values in a string. For example I could have a string: "<circle x="%" y="%">" and then I would replace the %...
3
by: ommail | last post by:
Hi I wonder if regular expressions are in general sower than using classes like String and Char when used for validating/parsing text data? I've done some simple test (using IsMatch()) method...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.