Hi
I need to convert any letter that occur twice or more within a word with a single letter of itself.
For example:
School -> Schol
Google -> Gogle
Gooooogle -> Gogle
VooDoo -> Vodo
I tried the following, but stuck at the second parameter in eregi_replace.
$word = 'Goooogle';
$word2 = eregi_replace("([a-z]{2,})", "?", $word);
If ...
I have custom tag for FLASH object, which i want to include in cms content. now when i read the content, i would like to grab those custom tag and the value in between.
Custom TAG:
<myflash filename="test.swf" width="500" height="400">
<param name="wmode" value="somevalue"></param>
<param name="bgcolor" value="#ffffff"></param>
<...
Hello,
I have List collection with around 35,000 strings
Typical string looks like this:
"<i>füüs</i>ampri tähis;lüh ld-st<i>anno</i>, aastal;<i>maj</i> lüh pr-st<i>argent</i>, raha (kursisedelitel)"
Basically this string contains bunch of words in Estonian :)
I need to allow user to perform RegExp search on 35,000 strings
If I pe...
I need help with regular expression.
I have very large collection of text files with different contents. But every file contains one hexadecimal key. Every key has exactly 16 hexadecimal digits ("E4 34 F1 FB...") and always begins with "00" or "01". In some cases they have one separator character (":").
Here are some example keys:
00...
Hi All,
Let's consider the two following lines in C# (using framework .NET 3.5)
Regex regex = new Regex(@"^((E|e)t )?(M|m)oi (?<NewName>[A-Za-z]\.?\w*((\-|\s)?[A-Za-z]?\w{1,})+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
Match m = regex.Match("moi aussi jaimerai etre un ordinateur pour pas m'énnerver ");
(sorry it's a frenc...
I run the following code
sed 's/\([^ ]+\) your \([^ ]+\)/ \2\1er/' < fail
The file fail is
fail your test
The above command gives me
fail your test
although it should give "testfailer".
The second and first globs \2\1 should be at the start of the word "er".
This suggests me that the problem may be in the regexes in the searc...
I've been wondering for long why there doesn't seem to be any parsers for, say, BNF, that behave like regexps in various libraries.
Sure, there's things like ANTLR, Yacc and many others that generate code which, in turn, can parse a CFG, but there doesn't seem to be a library that can do that without the intermediate step.
I'm interest...
I'm generating regular expressions dynamically by running through some xml structure and building up the statement as I shoot through its node types. I'm using this regular expression as part of a Layout type that I defined. I then parse through a text file that has an Id in the beginning of each line. This id points me to a specific lay...
Hello,
am new to lex and I wanna take all the matches specific to a regular expression
for example in the following text :
/* text text
text
text
text */
text text
/* text text text text text text
text text */
i wanna choose the two matches between /* and */
but lex matches the whole outer match and doen't return the two!
I u...
Hello,
I trying to find a pattern in files, but i when i get a match using select-string, i don't want the entire line, i just want the part that matched. Is there a parameter i can specify to do this?
Ex:
If i did
select-string .-.-.
and the file contained a line with:
abc 1-2-3 abc
I'd like to get a result of just "1-2-3" inst...
Hi,
I want to use JavaScript to restrict input on a text box to currency number formatting. For example:
<input type="text" value="2,500.00" name="rate" />
As given above, the text box should accept only numbers, commas and a period.
But, after the period it should accept two digits after numbers.
How do I accomplish this? Please ...
Hi
Consider this string
hello awesome <a href="" rel="external" title="so awesome is cool"> stuff stuff
What regex could I use to match any occurence of awesome which doesn't appear within the title attribute of the anchor?
So far, this is what I've came up with (it doesn't work sadly)
/[^."]*(awesome)[^."]*/i
Edit
I took Alan M...
Hi,
I need to do a search and replace on long text strings. I want to find all instances of broken links that look like this:
<a href="http://any.url.here/%7BlocalLink:1369%7D%7C%7CThank%20you%20for%20registering">broken link</a>
and fix it so that it looks like this:
<a href="/{localLink:1369}" title="Thank you for registering">...
I have a MySQL table with a column of well-formed URLs. I'd like to get a table of the unique domain names in the column, and the number of times each domain appears. Is there a MySQL query that can do this?
I thought of doing something like...
SELECT COUNT(*)
FROM log
GROUP BY url REGEXP "/* regexp here */"
...but this doesn't work ...
Greetings,
In Jmeter's regex component, I am running into an issue when the expression has both a variable AND a literal '$'. It always returns as fail. When I replace the variable with a hardcoded value, it works fine. I have verified the variable is returning the expected value in previous call.
Failed Expression: (variable and lit...
I'm trying to append query parameters to links within blocks of text within a class, such as
<div class="container">
consectetur <a href="foo.php?q=bar">adipisicing</a>
</div>
where the ?q=bar is appended.
Here's my function:
function appendRef(container,reftag) {
var Link = $(container).attr("href");
var afterLink = reftag;
$(...
I want to get an HTML page with python and then print out all the IPs from it.
I will define an IP as the following:
x.x.x.x:y
Where:
x = a number between 0 and 256.
y = a number with < 7 digits.
Thanks.
...
I am writing a curl script for collecting information about some sex offenders, i have developed the script that is picking up links like given below:
http://criminaljustice.state.ny.us/cgi/internet/nsor/... (snipped URL)
Now when we go on this link I want to get information under all the fields on this page like Offender Id:, last nam...
I was hoping to write my own syntax highlighter for a summer project I am thinking of working on but I am not sure how to write my own syntax highlighter.
I know that there are bunch of implementations out there but I would like to learn about regular expressions and how syntax highlighting works.
How does syntax highlighting work and ...
How does one extract only the formatting part from a string. For example:
if I have a string = "Warning: the error {0} has occurred. {1, 9} module has {2:0%} done."
I would like to extract {0}, {1,9} and {2:0%} out into a sting array. Is there a regular expression or something that can be done other than my way of looping the string wit...