Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > [announcement] ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2156 of 2234
Post > Topic >>

[announcement] runawk-0.11.0 has been released

by Aleksey Cheusov <vle@[EMAIL PROTECTED] > Feb 9, 2008 at 05:53 PM

runawk-0.11.0 has been released
Source code is available from http://sourceforge.net/projects/runawk

Feedback is welcome

NEWS:

    New modules

      tokenre.awk:

	 By default AWK splits input strings into tokens according to regular
	 expression that defines "space" between tokens using special
	 variable FS. In many situations it is more useful to define regular
	 expressions for tokens themselves. This is what this module does.

	 tokenre(STRING, REGEXP)
	 `tokenre' extracts substrings from STRING
	 according to REGEXP from the left to the right and assigns $1, $2
	 etc. and NF variable.

	 tokenre0(REGEXP)
	 Does the the same as `tokenre' but splits $0 instead

	 TRE - variable. If it is set to not empty string, splitting is
	 made by default for all input strings.

	 For example:
	 tokenre("print \"Hello world!\"", "\"([^\"]|\\\")*\"|[[:alnum:]_]+")
	 | NF == 2
	 | $1 == print
	 | $2 == "Hello world!"

      str2regexp.awk

	 str2regex(STRING)
	 returns a regular expression that matches given STRING

	 For example:
	 print str2regexp("all special symbols: ^$(){}[].*+?|\\")
	 -| all special symbols: [^][$][(][)][{][}][[]\][.][*][+][?][|]\\

      multisub.awk

	 multisub(STRING, SUBST_REPLS)
	 `multisub' is a substitution function. It searches for
	 a list of substrings, specified in SUBST_REPL
	 in a left-most longest order and (if found) replaces
	 found fragments with appropriate replacement.
	 SUBST_REPL format: "SUBSTRING1:REPLACEMENT1  
SUBSTRING2:REPLACEMENT2...".
	 Three spaces separate substring:replacement pairs from each other.

	 For example:
	 print multisub("ABBABBBBBBAAB", "ABB:c   BBA:d   AB:e")
	 |- ccBBde

-- 
Best regards, Aleksey Cheusov.




 1 Posts in Topic:
[announcement] runawk-0.11.0 has been released
Aleksey Cheusov <vle@[  2008-02-09 17:53:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun May 11 17:42:09 CDT 2008.