I want to find a word which is only three letter and starts with t and ends with e. Is there any other way, apart from what i have done:
open (FH, "alice.txt");
@lines = <FH>;
close(FH);
foreach $words(@lines)
{
if($words =~ m/ t.e /g)
{
print $words," ";
}
}
Also I wanted to find words which are more than 3 letters lon...
How can you find files by the following regex?
[^.]
The solution may be in the commands: find, perl, ls
...
Hello!
I've already got help here for creating a quotation extraction function. Thanks alot, soulmerge!
Now I'm looking for regular expressions (PHP) which extract the cited text and the cited person. The person should be in one index (substring), the text in another index (substring).
For English texts, soulmerge proposed these regex...
Hi,
I'm trying to create a regex to tokenize a string. An example of the string is
ExeScript.ps1 $1, $0,%1, %3
Or it may be carelessly typed in as . ExeScript.ps1 $1, $0,%1, %3`
I use a simple regex string.
Regex RE = new Regex(@"[\s,\,]");
return (RE.Split(ActionItem));
I get a whole bunch of zeros between the script1.ps1 ...
I want to replace a user define format like...
ABC-####-09
to
ABC-0023-09
How many leading zero should be decide over how many '#' sign in format, and the length of default value to replace (23 in this case).
Is there any regular expression pattern to do this?
Thanks...
...
I am trying to determine what the following pattern match criteria allows me to enter:
\s*([\w\.-]+)\s*=\s*('[^']*'|"[^"]*"|[^\s]+)
From my attempt to decipher (by looking at the regex's I do understand) it seems to say I can start with any character sequence then I must have a brace followed by alphanumerics, then another sequence fo...
Hi,
I would like to know the .ini config file setup to make a route wherein the page number parameter is optional so that
http://news.mysite.com/national
http://news.mysite.com/national/1
point to the same page.
I have the code as follows
resources.router.routes.news_list.type = "Zend_Controller_Router_Route_Regex"
resources.route...
Hi,
I have below code in vb.net for validating alphanumeric characters, It is working fine for all alphanumeric characters, However I want to allow user, so that he can insert "*". Please provide me the new regular expression for the above issue.
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp...
Hello,
I have well-formed xml documents into string variables. I want to use preg_replace to add a defined attribute to every xml tags.
For example replace:
<tag1>
<tag2> some text </tag2>
</tag1>
by:
<tag1 attr="myAttr">
<tag2 attr="myAttr"> some text </tag2>
</tag1>
So I basically need the regex expression to find any start tag...
Hi, first question here!
I'm writing a grep type program for Windows, just for fun (using Mingw). It works well for text files where lines are terminated by '\n'. I'm using fstream::getline() for this.
But I also need to be able to search files containing just a giant block of text with no line numbers. fstream::getline() fails here. I...
Since VBScript doesn't support lookbehinds, I'm looking for an alternative solution.
I have the string '\E\F\'.
I want to replace \F\ with '~', but ONLY if it is not preceded by a \E.
After the substitution, I want '\E\F\' to be '\E\F\'.
If the string was 'randomText\F\', I would want it to look like 'randomText~' after the substi...
Hi,
I would need to write a RegExp in AS3 which parses an Excel formatted currency value into a number:
E.g.
RegExp($35,600.00) = 35600
And checks if it is correctly formatted (with the "," as the thousands separator, and the "." as the decimal point. The currency symbol could be any (not just $) and could stand at the beginning or...
Hi,
trying to use regex to replace any white space with " ", inside of example html
<span someattr="a">and some words with spaces</span>
It's a desktop app and this html is coming to/from a third party control and don't have the luxury of working with any type of html parsing so am stuck with regex
I can't seem come up with a r...
I'm trying to validate user input, which is just comma separated numbers. I'd like to do this with RegEx, but can't come up with the right expression.
It should validate the following strings (and larger):
1
12
123
1,234
12,345
123,456
and invalidate the following strings (and crazier):
1,1
1,12
12,1
12,12
123,1
123,1
Any help wou...
I am trying to validate a date entered into a text box. There is an input mask on the textbox which forces input of xx/xx/xxxx. I am trying to use a regular expression validator to enforce that a correct date is entered. I am not skilled in RegEx bascially at all. My co-worker found this one on the internet but I can't really tell what ...
Consider the requirement to find a matched pair of set of characters, and remove any characters between them, as well as those characters/delimiters.
Here are the sets of delimiters:
[] //square brackets
() //parenthesis
"" //double quotes
'' //single quotes
Here are some examples of some strings that should match:
**Given** ...
In need of a regex master here!
<img src="\img.gif" style="float:left; border:0" />
<img src="\img.gif" style="border:0; float:right" />
Given the above HTML, I need a regex pattern that will match "float:right" or "float:left" but only on an img tag.
Thanks in advance!
...
I have a test file that has many lines, each line looks something like:
4:19 PM 5:15 PM this is some text blah blah
I need a regex that will pull the 2 times and assign them to a variable.
So basically i'm going to be looping through a text file, and extracting the time information from each line and adding up the difference betwee...
Hi,
I need to process a HTML content and replace the IMG SRC value with the actual data. For this I have choose Regular Expressions.
In my first attempt I need to find the IMG tags. For this I am using the following expression:
<img.*src.*=\s*".*"
Then within the IMG tag I am looking for SRC="..." and replace it with the new SRC val...
I have a function that uses Pattern.compile and a Matcher to search a list of strings for a pattern. This function is used in multiple threads. Each thread will have a unique pattern passed to the Pattern.compile when the thread is created. The number of threads and patterns are dynamic, meaning that I can add more patterns and thread...