I am trying to write a scheme function that takes a list of the form:
((#f ((1 1) (2 1)))
(#f ((1 3) (5 1)))
(#f ((1 4) (7 1)))
)
and removes all the #f to give a list like:
( ((1 1) (2 1))
((1 3) (5 1))
((1 4) (7 1))
)
I have tried the following code but cannot get it to work:
(define meth
(lambda lst
(if (equal? (cdr...
Hi i'm trying to find all occurences of '<?' in my php code. I use eclipse for this, and i tried to search for the folowing pattern: "<\?^[p]" in the hope this would return me all <? occrences, but not the <?php ones..
What's wrong about the regex? I thought I had figured out regular expressions, but it seams like i still have a long wa...
Hi,
I guess the following line of code looks familiar to many...
[^A-Za-z0-9]
And what I'd like to do is to keep a block of "text", alphnumeric as stated above and plus punctuations and other special characters that sql for MS Access can handle, also, the special character of # sign would be replaced with ## (a double of it to escape a ...
I have a config file that the user can specify sections, and then within those section they can specify regular expressions. I have to parse this config file and separate the regex's into the various sections.
Is there an easy way to delimitate a regex from a section header? I was thinking just the standard
[section]
regex1
regex2
B...
thecompletestring must match complete
thecompletelystring must not match complete
theuncompletestring must not match complete
theuncompletelystring must not match complete
I tried word boundaries, but they don't work in URLs.
I have a word list in an array, one word, one item.
How to match a word if it isn't inside an other word?
...
Hi all
I want to use the php function preg_match_all to find a part of the html code to replace it by another one.
This is what I need to find:
<attachfiles>
tag{link} attr{rel="stylesheet" type="text/css" media="screen"}
sources{
file1.css,
file2.css
}
</attachfiles>
I made a regular expression that find it but only if that code ...
Ok first off I am using built-in .NET regex this I what I was told I am using. I am using the group function A(.*?)B than I am replacing it with nothing (basically removing it). What I am doing is removing some unwanted stuff from the end of a url I am scraping.
But the problem is for "B" I am using the quote which needs to be in there....
I have already made a regex which should work, but it doesn't work.
echo "FileName.17:09:2010 4.16.PM.720p.mp4" | sed -E 's/\d{2}:\d{2}:\d{4}\ (\d|\d{2})\.(\d{2}|\d)\.((AM)|(PM))//g'
Should output: FileName..720p.mp4
But instead outputs the same "FileName.17:09:2010 4.16.PM.720p.mp4".
...
Hey,
I'm writing a php forms class with client and server side validation. I'm having problems checking if a literal backslash ("\") exists in a string using regular expressions in javascript.
I want to shy away from solutions other than using regex as this will reduce the amount of special cases between php and js AND reduce the amou...
What I want to do is to filter a table to only show the tbody that contains a given value against a value entered into a textbox, and to show the filtered rows in a zebra stripe pattern.
The zebra striping is fast, the filtering is generally fast, except on the first filter on a table with a lot of tbodys (say 2000 tbody? ... I haven't ...
I'm accessing some website and I need to extract some data. To be more specific - from this part:
<input type="hidden" value="1" name="d520783895194bd08750e47c744d553d">
I need to extract the "name" part. I heard that reular expressions are not the best solution, so I'd like to ask what is the best way to access this piece of data I n...
This method is to prevent users from entering anything but numbers and "allowed characters." Allowed characters are passed as the parameter allowedchars.
So far, the method prevents number entries but the allowedchars doesn't work (tried with passing "-" (hyphen) and "." (period)). So I'm assuming my dynamic regex construction isn't...
Hi,
I have an input string with a very simple pattern - capital letter, integer, capital letter, integer, ... and I would like to separate each capital letter and each integer. I have been dealing with it for quite a while and can't figure out what is the best way to do that in Java, I have already tried regexp using Pattern and Match...
I am trying to match on this string "$0.05/$0.10" and came up with this regular expression but I keep getting the error newline expression in constant, where have I gone wrong? Obviously the string can change and be with or without the decimal place so this would be valid also $25/$50 or or $1/$2.
My attempt:
@"\(\$(\d+\.\d{2})\+\$(\d...
If I feed a speech synthesizer (festival, in this case, but it applies to all) the following bit of text:
"At the USPGA championship in the US, the BBC reporter went MIA".
it reads
"At the uspga championship in the us, the BBC reporter went mia".
In other words, I guess that because it's a cluster of consonants, it reads "BBC" properl...
if i have a string like
<p>this is some content</p><script>alert('hello');</script>
i want to get the string without any scripts, but with the formatting, how do i do it?
<p>this is some content</p>
i tried
var html = "<p>etc</p><script>alert('hello world');</script>".replace("<script*</script>", "p");
but that gave me somethin...
My application fetches information from an API. Unfortunately their data isn't very pretty. This is what the strings can look like:
2
2:30
10.00
2 am
3:30 pm
10:00pm est
10:00pm PT/EST
10:00pm (Central)
10:00, 11:00 & 12:00
I mean, they can pretty much be anything :)
I need the format to be 12:00 (HH:MM) !
Here is what I've got so ...
Is it possible to use an input() with regex
I've written something like this
import re
words = ['cats', 'cates', 'dog', 'ship']
for l in words:
m = re.search( r'cat..', l)
if m:
print l
else:
print 'none'
this will return 'cates'
But now I want to be able to use my own input() in ' m = re.search( r'cat..', l)...
This question is an educational demonstration of the usage of lookahead, nested reference, and conditionals in a PCRE pattern to match ALL palindromes, including the ones that can't be matched by the recursive pattern given in the PCRE man page.
Examine this PCRE pattern in PHP snippet:
$palindrome = '/(?x)
^
(?:
(.) (?=
...
Is there an efficient way to search a message for substrings which might represent a time?
For example, this message:
let's meet tomorrow at 14:30 or do you prefer 2:30pm?
should return ('14:30', '2:30pm'). Finding hh:mm times can be easily achieved using a simple regex, but I'm wondering if there are existing solutions to find mo...