grzesiek.log
GNU/Linux, networks and other stuff
Sites
Start
My Publications
Showing posts with label
regex
.
Show all posts
Showing posts with label
regex
.
Show all posts
Thursday, November 18, 2010
"if ($answer =~ /Y|y/)" Python też tak może
import re
import sys
print "...[Y/N]?"
answer = sys.stdin.read(1)
if re.search("Y|y",answer):
print "tak"
elif re.search("N|n",answer):
print "nie"
Monday, November 15, 2010
"\1" pierwszy zapamiętany wzorzec
grzesiek@home:~$ echo "ABCD" | sed -r 's/(.)/ \1/g'
A B C D
grzesiek@home:~$ echo "ABCD" | sed -r 's/(.)/\1 /g'
A B C D
grzesiek@home:~$ echo "ABCD" | sed -r 's/(.)([ABCD])/\1 -\2/g'
A -BC -D
http://www.linuxquestions.org/questions/programming-9/how-to-insert-characters-into-a-string-in-shellscripts-844413/
http://www.grymoire.com/Unix/Sed.html#uh-4
http://www.regular-expressions.info/
Older Posts
Home
Subscribe to:
Posts (Atom)