Hello,
Let say I have a string with content "Free 100%". How can extract only "100" using ksh? I would this machanism to work if instead of "100" there is any kind of combination of numbers(ex. "32", "1238", "1"). I want to get only the digits.
I have written something like this:
... (4 Replies)
how to find for a file whose name has all characters in uppercase after 'project'?
I tried this:
find . -name 'project**.pdf'
./projectABC.pdf
./projectABC123.pdf
I want only ./projectABC.pdf
What is the regular expression that correponds to "all characters are capital"?
thanks (8 Replies)
Hi,
below is a piece of code written by my predecessor at work.
I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code.
It is really a tough time for me to figure out all the regular expressions.
Please shed some light on the regular expressions... (3 Replies)
Hi,
I'm trying to use sed to extract some text and assign it to a variable.
Can anyone provide me with some help? it would be much appreciated!
I"m looking to extract for example:
filename=/output/R34/2005_13_R34_C1042S_T83_CRFTXT_20081015.txt
I'm trying to extract the 1042... (9 Replies)
Hi,
In ksh, I am trying to compare folder names having -141- in it's name.
e.g.: 4567-141-8098 should match this expression '*-141-*'
but, -141-2354 should fail when compared with '*-141-*'
simlarly, abc should fail when compared with '*-141-*'
I tried multiple things but nevertheless,... (5 Replies)
In regular expressions with grep(or egrep), ^ works if we want something in starting of line..but what if we write ^^^ or ^ for pattern matching??..Hope u all r familiar with regular expressions for pattern matching.. (1 Reply)
#!/usr/bin/perl
$word = "one last challenge";
if ( $word =~ /^(\w+).*\s(\w+)$/ )
{
print "$1";
print "\n";
print "$2";
}
The output shows that "$1" is with result one and "$2" is with result challenge. I am confused about how this pattern match expression works step by step. I... (8 Replies)
what elements does " /^/ " match?
I did the test which indicates that it matches single lowercase character like 'a','b' etc. and '1','2' etc.
But I really confused with that. Because, "/^abc/" matches strings like "abcedf" or "abcddddee".
So, what does caret ^ really mean?
Any response... (2 Replies)
Hi
Ilove unix and alwyas trying to to learn unix,but i am weak in using regular expressions.can you please give me a littel brief discription that how can i understand them and how to use .your response could lead a great hand in my unix love. (1 Reply)
Discussion started by: manoj attri
1 Replies
LEARN ABOUT DEBIAN
gcap.1
GCAP.1(1p) User Contributed Perl Documentation GCAP.1(1p)NAME
gcap - Youtube closed caption downloader
SYNOPSIS
gcap [-i] [-t] [-r <regexp>] [--proxy=<addr> | --no-proxy]
[--help] <url> | <video_id>
DESCRIPTION
gcap is a command line tool for downloading Youtube closed captions. The downloaded closed captions are saved in SubRip (srt) file format.
The srt files are saved as "$videoid_$langid.srt" by default.
OPTIONS --help
Print help and exit.
--version
Print version and exit.
-q, --quiet
Be quiet.
-i, --interactive
Open the interactive prompt which can be used to select the items. gcap selects all items by default. See also "INTERACTIVE PROMPT".
-t, --title
Parse video title and use it in the output filename(s) instead of video ID. The default is no.
-r, --regexp=arg
Cleanup video title using the specified arg regular expression. The default is "/(w|s)/g".
--proxy arg
Use arg for HTTP proxy, e.g. "http://foo:1234". Overrides the http_proxy environment setting.
--no-proxy
Disable use of HTTP proxy. Overrides both "--proxy" and http_proxy environment settings.
INTERACTIVE PROMPT
Use the "--interactive" switch to open the prompt. Note that gcap uses (as of 0.1.0) the Umph::Prompt module for this. Once the prompt
opens, type "help" to get a list of commands available to the prompt.
EXAMPLES
gcap 0QRO3gKj3qw
gcap "http://www.youtube.com/watch?v=0QRO3gKj3qw"
Both yield the same results.
gcap -ti 0QRO3gKj3qw
Same as above two but use video title in the filename and choose which of the closed captions should be downloaded.
EXIT STATUS
Exits 0 on success, otherwise 1.
FILES
$HOME/.gcaprc, for example:
echo "--interactive" >> ~/.gcaprc
NOTES
Availability
The following error message produced by gcap (or the XML::DOM module) typically indicates that the video does not have any closed
captions available for it (URL omitted for brewity):
Couldn't parsefile [...] with LWP: no element found at line 1,
column 0, byte -1 at [...]/XML/Parser.pm [...]
http_proxy
gcap depends on XML::DOM which uses LWP::UserAgent to download the data. Note that LWP::UserAgent reads http_proxy environment setting.
e.g.:
env http_proxy=http://foo:1234 gcap video_id
WWW
<http://gcap.googlecode.com/>
<http://repo.or.cz/w/gcap.git>
AUTHOR
Toni Gundogdu <legatvs at sign cpan org>
perl v5.12.4 2011-11-15 GCAP.1(1p)