Hi all,
I would like to extract values after I match the keyword "coor" multiple times in a string. My code doesn't do that at all. Can anyone help me to fix it please?
My code:
my $str = ;
if ($str =~ /$keyword/)
{
if ($' =~ /\[/) #'# everything after the matched string
{
$str=~ /\(coor\s(\d+)\s(\d+)\)\s\(coor\s(\d+)\s(\d+)\)...
I've got a HTML file, and I'd like to grab all the links that are in the file and save it into another file using Vim.
I know that the regex would be something like:
:g/href="\v([a-z_/]+)"/
but I don't know where to go from here.
...
I have match regular expresion in Perl.
The match sentence that spreads over more than one line.
I realize that I must enter the match regular expresion in one line only, if I spread
to multiple lines it fails:
$array_11 =~ m{By Steve (.*), MarketWatch LONDON (.*) -- Shares of Anglo American rallied on Monday morning as (.*) bet that t...
I seem to have confused myself with a preg_match regex I'm doing, so fresh eyes and help would be appreciated.
My current regex is as follows:
/<!--menu:start:\(([0-9])\,([0-9])\)-->(.*?)<!--menu:end-->/se
I am looking to make the number input and colon e.g. :(1,4) optional, so it would match:
<!--menu:start--><!--menu:end-->
or
...
I'm working with long paragraphs of text that are searchable using MySQL and PHP. I'd like to be able to find and highlight only the relevant search terms and use regex to isolate them.
For example, I'd like to transform a Lorem ipsum paragraph,
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt...
I need a regex that will parse a csv-style file, something like 57 fields wide, most fields enclosed in quotes (but maybe not all), separated by commas, with quoted fields having the possibility of embedded doubles ("") that represent single quotes in the evaluated string.
I'm a regex beginner/intermediate, and I think I can get pretty ...
Hello.
I can't seem to understand regular expression at all. How can I match a character which resides between a START and END string. For Example
#START-EDIT
#ValueA=0
#ValueB=1
#END-EDIT
I want to match any # which is between the #START-EDIT and #END-EDIT.
Specifically I want to use sed to replace the matches # values with not...
I have asp:TextBox to keep a value of money, i.e. '1000', '1000,0' and '1000,00' (comma is the delimiter because of Russian standard).
What ValidationExpression have I to use into appropriate asp:RegularExpressionValidator?
I tried \d+\,\d{0,2} but it doesn't allows a number without decimal digits, e.g. just '1000'.
...
I need to extract the src element from all image tags in an HTML document.
So, the input is an HTML page and the output would be a list of URL's pointing to images:
ex... http://www.google.com/intl/en_ALL/images/logo.gif
The following is what I came up with so far:
<img\s+src=""(http://.*?)
This does not work for tags where the src ...
I can't seem to find decent documentation on haskell's POSIX implementation.
Specifically the module Text.Regex.Posix.
Can anyone point me in the right direction of using multiline matching on a string?
A snippet for the curious:
> extractToken body = body =~ "<textarea[^>]*id=\"wpTextbox1\"[^>]*>(.*)</textarea>" :: String
I'm tryi...
I'm trying to extract only certain elements of a string using regular expressions and I want to end up with only the captured groups.
For example, I'd like to run something like (is|a) on a string like "This is a test" and be able to return only "is is a". The only way I can partially do it now is if I find the entire beginning and end...
I want to split a string into two parts, the string is almost free text,
for example:
$string = 'hi how are you';
and i want the split to look like this:
array(
[0] => hi
[1] => how are you
)
I tried using this regex: /(\S*)\s*(\.*)/ but even when the array returned is the correct size, the values comes empty.
What should ...
In a program I'm reading in some data files, part of which are formatted as a series of records each in square brackets. Each record contains a section title and a series of key/value pairs.
I originally wrote code to loop through and extract the values, but decided it could be done more elegantly using regular expressions. Below is my ...
Please tell me how to use the various symbols used for expression matching in preg_match function of PHP.
Besides basic information, please give example for checking a valid e-mail address and a string that should not contain / : ; { } * &
...
I am working with the following data:
__DATA__
Branch 1: 10..11
13 E 0.496 -> Q 0.724
18 S 0.507 -> R 0.513
19 N 0.485 -> S 0.681
Branch 2: 11..12
81 R 0.891 -> Q 0.639
88 Y 0.987 -> S 0.836
From the above data, I want to read numbers present before a character and then print them out. So for instance ...
OK, so I'm working with a little regular expression—it's my first time, please, be gentle—and I've run into a problem where I can set a variable with it but if I try to do anything with that variable it causes problems.
Here's my script:
$(document).ready(function () {
var show_number;
var url_param;
$("a[rel=more]").live(...
I have a system written in python that processes large amounts of data using plug-ins written by several developers with varying levels of experience.
Basically, the application starts several worker threads, then feeds them data. Each thread determines the plugin to use for an item and asks it to process the item. A plug-in is just a p...
I may have a hole in my regex knowlege.
If I am trying to look for items in a string which may be in the numeric range "item[355-502]" is there an easy way to do this. as far as I can tell I would have to do something like
(35[5-9]|3[6-9][0-9]|4[0-9][0-9]|50[0-2])
I know this also matches for 3550-5020 etc, that should be fine
Thi...
I'm trying to match the following items in the string pcode:
u followed by a 1 or 2 digit number
phaseu
phasep
x (surrounded by non-word chars)
y (surrounded by non-word chars)
z (surrounded by non-word chars)
I've tried to implement a regex match using the POSIX regex functions (shown below), but have two problems:
The compiled pa...
I want to check whether a string is a file name (name DOT ext) or not.
Name of file cannot contain / ? * : ; { } \
Could you please suggest me the regex expression to use in preg_match()?
...