Olga,
It's not the regular expression you're hoping for, but using ksh's own regular expressions, I find that for beginning of word I can use: @(|*\W) and for end of word: @(\W*|) For example: $ x='Some string with myWord appearing somewhere in the sting as a "word".' $ [[ "$x" == @(|*\W)myWord@(\W*|) ]] && print yes || print no yes Regards, Dan ----- Original Message ----- From: "ольга крыжановская" <[email protected]> To: "ast-users" <[email protected]> Sent: Sunday, October 31, 2010 10:19:42 AM@(|*\W) Subject: [ast-users] Word boundaries \< and \> supported in ksh ~(E)? Does ksh ~(E) support word boundaries \< and \>? I have tried lengthy to get it working but I only receive failures. As example I tried this expression to match three words with the \< and \> word boundaries but instead \1 captures the whole string: x="hello 12 world" ; y="${x/~(Elr)\<(.+)\>\<(.+)\>\<(.+)\>/\1}" ; printf "%s\n" "$y" hello 12 world I need an example which works, and if ~(P) supports word boundaries I need an example here, too. Olga -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ [email protected] \-`\-'----. `'-..-| / http://twitter.com/fleyta \ |-..-'` /\/\ Solaris/BSD//C/C++ programmer /\/\ `--` `--` _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
_______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
