Naming Conventions |
|||||
|
Scalar |
Vector |
Matrix |
Any |
Non- |
Boolean |
BS |
BV |
BM |
BA |
BN |
Integer |
IS |
IV |
IM |
IA |
IN |
Float |
FS |
FV |
FM |
FA |
FN |
Numeric |
NS |
NV |
NM |
NA |
NN |
Character |
CS |
CV |
CM |
CA |
CN |
Enclosed |
ES |
EV |
EM |
EA |
EN |
enclosed |
TS |
TV |
TM |
TA |
TN |
Simple |
SS |
SV |
SM |
SA |
SN |
Any |
AS |
AV |
AM |
AA |
AN |
phrase e.g.: .X...Y. ⍝ X←BS; Y←IV |
|||||
combinations: use ISV for Integer scalar∨vector |
|||||
B3, I4 &c. to specify higher ranks. |
|||||
Between
Sometimes one needs to find everything that's embraced by certain characters.
B∨≠\B←V∊S ⍝ V←CV; S←CV; (⍴S)∊1 2
Examples
A typical example would be to analyse an HTML page in order to get either all the tags or the contents:
⎕FX⊃'r←cv Between sep;bv' 'r←bv∨≠\bv←cv∊sep'
cv←'<div id="adr"><p>John Doe</p><p>London</p></div>'
⊃(cv Between'<>')⊂cv
<div id="adr"><p>
</p><p>
</p></div>
⊃(~cv Between'<>')⊂cv
John Doe
London Note that this will work only on well-formed HTML.
Specialities
....
Compatibility
Checked with: APL2, APLX, Dyalog, NARS2000
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
See also: ...
Mentor: KaiJaeger
Tags: <Text> <Character>
CategoryPhrasesAll - CategoryPhraseSelection - CategoryPhraseBooleans
APL Wiki