Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: regular

16 Jun

Regular Expression Twitter Linker

Regular expression to link twitter users…


Replace this '@(\w+)'
With this '<a href="http://twitter.com/\1">@\1</a>'
admin Posted in Code expression, link, regexp, regular, twitter 3 Comments
15 May

Locate Files With Names Matching A Regexp

You can use locate to find files with name that matches a said regexp…


locate -i -r '\.jpg$'
admin Posted in Command Line, Linux command, expression, file, find, Linux, locate, name, regex, regexp, regular Leave a comment
31 May

Sed Regular Expression Range

Print the contents of a file from a given regular expression to another


sed -n '/start/,/end/ p' file

This will print the contents of the ‘file’ from the line that matches /start/ until the line that matches /end/

admin Posted in Command Line, Linux command, expression, Linux, range, regexp, regular, sed Leave a comment
01 Oct

Command to Print Until Regular Expression

Print a file until a regular expression is matched.


cat file.txt | perl -pe "exit if(/Thats all/)"
admin Posted in Command Line, Perl command, expression, match, Perl, regular, string Leave a comment

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑