Skip to main content

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

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?