Support for regular expressions in APL? 
Author Message
 Support for regular expressions in APL?

I have been experimenting with the Perl language recently and
have found its regular expression syntax to be quite powerful and
useful.  It seems to me that it would be useful to extend APL to
support a version of regular expressions, perhaps as an extension
to the "find" function.  It could be initially implemented as an
auxiliary processor for experimentation.

Given the generalized array features of second generation APLs
it should be simple to apply regular expressions to numeric data
as well as characters, e.g.  '['  12.3  '-'  100.5  ']+'  would match
any sequence of one or more numbers x for which
12.3 <= x <= 100.5.  Defining the result to be similar to that for
"find" would allow this feature to be applied to arrays of
arbitrary rank.

Another possibility would be to have the regular expression handler
take a two-element left argument, one of which was the regular
expression itself, the other being a character representation of an
APL expression to be applied to all matching sections of an array.
That would be an interesting and powerful control structure.

--- Brian



Thu, 24 May 2001 03:00:00 GMT  
 Support for regular expressions in APL?
Regular expressions already exist in the ss (string search and replace)
function in the xutils auxiliary processor in Dyalog APL, and has always
done so, even in their versions for the PC.



Quote:
>I have been experimenting with the Perl language recently and
>have found its regular expression syntax to be quite powerful and
>useful.  It seems to me that it would be useful to extend APL to
>support a version of regular expressions, perhaps as an extension
>to the "find" function.  It could be initially implemented as an
>auxiliary processor for experimentation.

>Given the generalized array features of second generation APLs
>it should be simple to apply regular expressions to numeric data
>as well as characters, e.g.  '['  12.3  '-'  100.5  ']+'  would match
>any sequence of one or more numbers x for which
>12.3 <= x <= 100.5.  Defining the result to be similar to that for
>"find" would allow this feature to be applied to arrays of
>arbitrary rank.

>Another possibility would be to have the regular expression handler
>take a two-element left argument, one of which was the regular
>expression itself, the other being a character representation of an
>APL expression to be applied to all matching sections of an array.
>That would be an interesting and powerful control structure.

>--- Brian

John Sullivan
-------------
Die dulci fruimini, o vos omnes!
remove the dots from the first three (Welsh) words for my real address


Thu, 24 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. regular expression matching in J ? (or APL)

2. apl and regular expressions

3. php like regular expressions in apl?

4. regular expression support

5. tkREM - Emacs Regular Expression Support

6. Tgen, linear algebra, and regular expression package available

7. Regular Expressions

8. Regular Expression Matcher v1.1

9. Benchmarking Regular Expressions in J3.05

10. regular expression discussion

11. Regular Expressions in J

12. Regular Expression to match HTML elements

 

 
Powered by phpBB® Forum Software