php like regular expressions in apl? 
Author Message
 php like regular expressions in apl?

What I should really like to have in APL are PHP/Perl etc like regular
expression handling functions (primitive or not). The PHP-function
below searches the stock exchange rate for a given company symbol like
"NOK". The regular expressions in the Internet languages like PHP are
used for information gathering (screen scraping). The APL users are
very often analysts, researchers and mathematicians who want to take
the benefit of the many information sources of the Internet.

function takerate($symbol)

{ // connect to URL and read information

  $theurl = " http://www.*-*-*.com/ ;


if (!($fp = fopen($theurl, "r")))


    echo "Could not open URL";

    exit; }

$contents = fread($fp, 1000000);


// find the part of the page we want and output it

  $pattern = "(\\\$ [0-9 ]+\\.[0-9]+)";

  if (eregi($pattern, $contents, $quote))

 { echo "$symbol ";

   echo $quote[1];

   echo "<br>";

 } else


    echo "No quote available for $symbol <br>";




Sun, 18 Jan 2004 13:49:40 GMT  
 [ 1 post ] 

 Relevant Pages 

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

2. apl and regular expressions

3. Support for regular expressions in APL?

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

5. Regular Expressions

6. Regular Expression Matcher v1.1

7. Benchmarking Regular Expressions in J3.05

8. regular expression discussion

9. Regular Expressions in J

10. Regular Expression to match HTML elements

11. Using regular expressions to validate data

12. Variable length regular expression


Powered by phpBB® Forum Software