Thread: Novice Regex Question
really dumb regex question, how invoke command terminal use following regex command? presume combination of cat on file urls , grep?
here's regex command (from http://daringfireball.net/2010/07/im...atching_urls):
code:(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
grep 'pattern' filename
or equivalent
grep 'pattern' < filename
if want grep fixed string, use
echo 'string' | grep 'pattern'
complex patterns, important encase them in single quotes bash shell won't try , interpret pattern. if you're searching single word, can omit quotes.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Novice Regex Question
Ubuntu
Comments
Post a Comment