Loading ...
Sorry, an error occurred while loading the content.

Re: [NTB] Regular Expression replacement syntax

Expand Messages
  • Alec Burgess
    Here s one not very elegant way ... H=trim ((#-to eol)-repeated) to (blank line) ; (1) trim trailing blanks, (2) dump digits, (3)join # s, (4) dump # s, (5)
    Message 1 of 1 , Mar 18 1:57 PM
    • 0 Attachment
      Here's one not very elegant way


      >>
      H=trim ((#-to eol)-repeated) to (blank line)

      ; (1) trim trailing blanks, (2) dump digits, (3)join "#"'s, (4) dump "#'s,
      (5) dump extra blank lines

      ^!replace " ^p" >> "^p" wsa
      ^!replace "#\d+;\s?" >> "#" rwsa
      ^!replace "#\n#" >> "#" rwsa
      ^!replace "#+" >> "" rwsa
      ^!replace "^p^p^p" >> "^p^p" swa
      <<

      Regards ... Alec
      --
      ----- Original Message -----
      From: "AL Cantley" <acantley@...>
      To: <notetab@yahoogroups.com>
      Sent: Tuesday, March 18, 2003 11:44
      Subject: [NTB] Regular Expression replacement syntax


      > I am trying to replace (delete) all paragraphs in a long document that
      > begin with "#nnnn" (where n=any digit) AND end with "nnnn;" - some of
      > the sample paragraphs follow:
      >
      > <snip>
      >
      > In another saying of `Ali, the son in law and spiritual Brother of the
      > Prophet Muhammad, we see an elaboration of Muhammad's famous oral
      > tradition: "A wise saying is a lost and long-sought article of the
      > believer. Therefore, acquire it even if it is to be found with
      > hypocrites." Anas said that Muhammad, the Messenger of Allah said:
      > "Seeking of knowledge is obligatory upon every Muslim."
      > #1593;#1614;#1606;#1618; #1571;#1614;#1606;#1614;#1587;#1616;
      > #1576;#1618;#1606;#1616; #1605;#1614;#1575;#1604;#1616;#1603;#1613;
      > #1602;#1614;#1575;#1604;#1614; #1602;#1614;#1575;#1604;#1614;
      > #1585;#1614;#1587;#1615;#1608;#1604;#1615;
      > #1575;#1604;#1604;#1617;#1614;#1607;#1616;
      > #1589;#1614;#1604;#1617;#1614;#1609;
      > #1575;#1604;#1604;#1617;#1614;#1607;
      > #1593;#1614;#1604;#1614;#1610;#1618;#1607;#1616;
      > #1608;#1614;#1587;#1614;#1604;#1617;#1614;#1605;#1614;
      > #1591;#1614;#1604;#1614;#1576;#1615;
      > #1575;#1604;#1618;#1593;#1616;#1604;#1618;#1605;#1616;
      > #1601;#1614;#1585;#1616;#1610;#1590;#1614;#1577;#1612;
      > #1593;#1614;#1604;#1614;#1609; #1603;#1615;#1604;#1617;#1616;
      > #1605;#1615;#1587;#1618;#1604;#1616;#1605;#1613;
      > It is reported by Anas that the Messenger of Allah said: "Whoever goes
      > out to seek knowledge is in Allah's path till he returns."
      > #1593;#1614;#1606;#1618; #1571;#1614;#1606;#1614;#1587;#1616;
      > #1575;#1576;#1618;#1606;#1616;
      > #1605;#1614;#1575;#1604;#1616;#1603;#1613;
      > #1602;#1614;#1575;#1604;#1614; #1602;#1614;#1575;#1604;#1614;
      > #1585;#1614;#1587;#1615;#1608;#1604;#1615;
      > #1575;#1604;#1604;#1617;#1614;#1607;#1616;
      > #1589;#1614;#1604;#1617;#1614;#1609;
      > #1575;#1604;#1604;#1617;#1614;#1607;
      > #1593;#1614;#1604;#1614;#1610;#1618;#1607;#1616;
      > #1608;#1614;#1587;#1614;#1604;#1617;#1614;#1605;#1614;
      > #1605;#1614;#1606;#1618; #1582;#1614;#1585;#1614;#1580;#1614;
      > #1601;#1616;#1610; #1591;#1614;#1604;#1614;#1576;#1616;
      > #1575;#1604;#1618;#1593;#1616;#1604;#1618;#1605;#1616;
      > #1603;#1614;#1575;#1606;#1614; #1601;#1616;#1610;
      > #1587;#1614;#1576;#1616;#1610;#1604;#1616;
      > #1575;#1604;#1604;#1617;#1614;#1607;#1616;
      > #1581;#1614;#1578;#1617;#1614;#1609;
      > #1610;#1614;#1585;#1618;#1580;#1616;#1593;#1614;
      >
      > There can be no doubt as to the implications of these statement. Clearly
      > the teaching is that wherever there is Wisdom to be found, in whatever
      > teaching or tradition, it is the right and possession of the Believer,
      > regardless of whether or not the teaching itself is found within the
      > texts preserved and touted by hypocrites who do not follow said Wisdom.
      > Thus, the Qur'an is self-identified as "Al-Furqan" (the Criterion), as
      > it is the litmus test of the historicity and accuracy of any relevant
      > Scripture. Accordingly, the Torah or the Gospel can be studied, yet it
      > should be held up to the Light of the Qur'an for verification. Wherein
      > there is contradiction, we are to reason that God through His Archangel
      > Gabriel is CLARIFYING the matter in the Revelation of the Qur'an.
      > For example, the Torah says that it was Prophet Aharon who made the idol
      > of the Golden Calf. The Qur'an not only denies this, it gives a lengthy
      > historical account of one "craftsman" of Sumerian origins amongst the
      > Children of Israel, who infiltrated the migrating tribes in order to
      > lead them into transgression. To the common Jew or Christian this looks
      > like the Qur'an is in error. The Qur'an unequivocally states that this
      > is not the case. The Qur'an notes the difference and maintains that IT
      > is the correct and historically valid Revelation, while the older tribal
      > versions of the Bible were the victims of both Scribal corruption and
      > censorship over the years. "You have been caste off, O Samaria, because
      > of your Calf. My wrath is kindled against them; how long will they be
      > unable to achieve cleanliness." Hoshea 8:5
      >
      > <snip>
      >
      > I want to end up with:
      >
      > In another saying of `Ali, the son in law and spiritual Brother of the
      > Prophet Muhammad, we see an elaboration of Muhammad's famous oral
      > tradition: "A wise saying is a lost and long-sought article of the
      > believer. Therefore, acquire it even if it is to be found with
      > hypocrites." Anas said that Muhammad, the Messenger of Allah said:
      > "Seeking of knowledge is obligatory upon every Muslim."
      >
      > It is reported by Anas that the Messenger of Allah said: "Whoever goes
      > out to seek knowledge is in Allah's path till he returns."
      >
      > There can be no doubt as to the implications of these statement. Clearly
      > the teaching is that wherever there is Wisdom to be found, in whatever
      > teaching or tradition, it is the right and possession of the Believer,
      > regardless of whether or not the teaching itself is found within the
      > texts preserved and touted by hypocrites who do not follow said Wisdom.
      > Thus, the Qur'an is self-identified as "Al-Furqan" (the Criterion), as
      > it is the litmus test of the historicity and accuracy of any relevant
      > Scripture. Accordingly, the Torah or the Gospel can be studied, yet it
      > should be held up to the Light of the Qur'an for verification. Wherein
      > there is contradiction, we are to reason that God through His Archangel
      > Gabriel is CLARIFYING the matter in the Revelation of the Qur'an.
      > For example, the Torah says that it was Prophet Aharon who made the idol
      > of the Golden Calf. The Qur'an not only denies this, it gives a lengthy
      > historical account of one "craftsman" of Sumerian origins amongst the
      > Children of Israel, who infiltrated the migrating tribes in order to
      > lead them into transgression. To the common Jew or Christian this looks
      > like the Qur'an is in error. The Qur'an unequivocally states that this
      > is not the case. The Qur'an notes the difference and maintains that IT
      > is the correct and historically valid Revelation, while the older tribal
      > versions of the Bible were the victims of both Scribal corruption and
      > censorship over the years. "You have been caste off, O Samaria, because
      > of your Calf. My wrath is kindled against them; how long will they be
      > unable to achieve cleanliness." Hoshea 8:5
      >
      > Any help would be greatly appreciated.
      >
      >
      > Blessings,
      > Al Cantley
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > To unsubscribe click on address below and send the message empty:
      > mailto:notetab-unsubscribe@yahoogroups.com
      > http://groups.yahoo.com/list/notetab
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.