On a more general level of a "swearword filter", you will want to make your regex case-insensitive and avoid the substitution of "swearwords" which are part of "good" words.

If "ass" is a swearword, you probably will not want "assistant" to become "****istant".

And what will happen to a treatise about any of several hoofed mammals of the genus Equus, resembling and closely related to the horses but having a smaller build and longer ears, and including the domesticated donkey?

Would you also want to apply censorship to the Holy Scripture?

Of the domesticated species we read of,

  1. The she ass (Heb. 'athon), so named from its slowness (Gen. 12:16; 45:23; Num. 22:23; 1 Sam. 9:3).
  2. The male ass (Heb. hamor), the common working ass of Western Asia, so called from its red colour. Issachar is compared to a strong ass (Gen. 49:14). It was forbidden to yoke together an ass and an ox in the plough (Deut. 22:10).
  3. The ass's colt (Heb. 'air), mentioned Judg. 10:4; 12:14. It is rendered "foal" in Gen. 32:15; 49:11. (Comp. Job 11:12; Isa. 30:6.) The ass is an unclean animal, because it does not chew the cud (Lev. 11:26. Comp. 2 Kings 6:25). Asses constituted a considerable portion of wealth in ancient times (Gen. 12:16; 30:43; 1 Chr. 27:30; Job 1:3; 42:12). They were noted for their spirit and their attachment to their master (Isa. 1:3). They are frequently spoken of as having been ridden upon, as by Abraham (Gen. 22:3), Balaam (Num. 22:21), the disobedient prophet (1 Kings 13:23), the family of Abdon the judge, seventy in number (Judg. 12:14), Zipporah (Ex. 4:20), the Shunammite (1 Sam. 25:30), etc. Zechariah (9:9) predicted our Lord's triumphal entrance into Jerusalem, "riding upon an ass, and upon a colt," etc. (Matt. 21:5, R.V.).

Of wild asses two species are noticed, (1) that called in Hebrew _'arod_, mentioned Job 39:5 and Dan. 5:21, noted for its swiftness; and (2) that called _pe're_, the wild ass of Asia (Job 39:6-8; 6:5; 11:12; Isa. 32:14; Jer. 2:24; 14:6, etc.). The wild ass was distinguished for its fleetness and its extreme shyness. In allusion to his mode of life, Ishmael is likened to a wild ass (Gen. 16:12. Here the word is simply rendered "wild" in the Authorized Version, but in the Revised Version, "wild-ass among men").

Source: Easton's 1897 Bible Dictionary

Just give it up, censorship never works.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law


In reply to Re: array of MySQL data for substitution by CountZero
in thread array of MySQL data for substitution by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.