Hi,
I am not an expert in boost, though I have used ublas extensively. Recently, my supervisor asked me to build boost regex for the gcc platform. My question is:
Why can't I use the regex as it is, like ublas?
Please give detailed answer.
...
how do i do this with regex?
i want to match this string: -myString
but i don't want to match the -myString in this string: --myString
myString is of course anything.
is it even possible?
EDIT:
here's a little more info with what i got so far since i've posted a question:
string to match:
some random stuff here -string1, --string2...
I'm trying to write a regular expression that surrounds "http" URLs with angle brackets, except for lines beginning with two slashes. The best I've come up with is:
s#^(?!//)(.*?)(http://[^\s]+)#$1<$2>#gm;
This works great for these two:
Input: http://a.com
Output: <http://a.com>
Input: //http://a.com
Output: //http://a.com
...
I have a Perl regular expression (shown here, though understanding the whole thing isn't hopefully necessary to answering this question) that contains the \G metacharacter. I'd like to translate it into Python, but Python doesn't appear to support \G. What can I do?
...
I'm detecting @replies in a Twitter stream with the following PHP code using regexes.
$text = preg_replace('!^@([A-Za-z0-9_]+)!', '<a href="http://twitter.com/$1" target="_blank">@$1</a>', $text);
$text = preg_replace('! @([A-Za-z0-9_]+)!', ' <a href="http://twitter.com/$1" target="_blank">@$1</a>', $text);
How can I best combine thes...
Does anyone know of a PDF file parser that I could use to pull out sections of text from the plaintext pdf file? Specifially I want a way to be able to reliably pull out the section of text specific to annotations?
Delphi, C# RegEx I dont mind.
...
How would I go about using a negative lookbehind(or any other method) regular expression to ignore strings that contains a specific substring?
I've read two previous stackoverflow questions:
java-regexp-for-file-filtering
regex-to-match-against-something-that-is-not-a-specific-substring
They are nearly what I want... my problem is the ...
Is it possible to write a single Python regular expression that can be applied to a multi-line string and change all occurrences of "foo" to "bar", but only on lines beginning with "#"?
I was able to get this working in Perl, using Perl's \G regular expression sigil, which matches the end of the previous match. However, Python doesn't a...
In my php application user able to enter the tags(like here while ask question).
I assume it will be regexp, and I used one - mb_split('\W+', $text) - to split by non-word characters.
But I want to allow users to enter characters like "-,_,+,#" etc which are valid ones to be in url and are common.
Is there exiting solutions for this...
I don't know enough to change the following so that it only puts <strong> around the first found string matching the term:
highlight: function(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\]){1}/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</stron...
I'm trying to match this character ’ which I can type with alt-0146. Word tells me its unicode 0x2019 but I can't seem to match it using regular expressions in coldfusion. Here's a snippet i'm using to match between 2 and 10 letters and apostrophes and this character
[[:alpha:]'\x2019]{2,10}
but it's not working. Any ideas?
...
The following code works, but I'm sure there is a more compact way to achieve the same result, particularly the string replacement:
$('#nav-main .nav-sub').each(function() {
var name = $(this).attr('id');
$(this).children('li').children('a').each(function() {
var text = $(this).text().toLowerCase();
var spaces = / /g;
var sub...
Would it be possible to make a regex that reads {variable} like <?php echo $variable ?> in PHP files?
Thanks
Remy
...
If you scan a folder containing other folders AND files, how do you get rid of . and .. and files? How do you put in array only folders WITHOUT . and ..?
I would like to use regular expression, but I'm newbie and I can't get it right.
My code is now this but doesn't work:
if(fnmatch("\.{1,2}",$dir_array[$i]) || is_file($dir_array[$i]...
gawk doesn't seem to match six digit fields - or n digit fields using the {n,m} quantifiers
It does match [0-9][0-9][0-9][0-9][0-9][0-9] ok.
Doesn't seem to support \d\d\d\d\d\d either.
Do i need to turn on extended reg ex, or does it just not support that.
Tnx
...
Hi guys,
Sorry if this is too little of a challenge to be suited as a stack overflow question, but I'm kind of new to Regular Expressions.
My question is, what is the regular expression that returns the string "token" for all the examples bellow?
token.domain.com
token.domain.com/
token.domain.com/index.php
token.domain.com/folder/...
Does anyone know what the regular expression in Ruby is to verify an email address is in proper RFC 2822 email format?
What I want to do is:
string.match(RFC_2822_REGEX)
where "RFC_2822_REGEX" is the regular expression to verify if my string is in valid RFC 2882 form.
...
STILL NOT RESOLVED :( [Feb 11th]
I have a large text file full of random data and want to pull out all the email addresses from it.
I would like to do this in Ruby, with pseudo code like this:
monster_data_string = "asfsfsdfsdfsf sfda **[email protected]** sdfdsf"
monster_data_string.match(EMAIL_REGEX)
Does anyone know what Ruby e...
Hi all,
I'm working on a web application that parses and displays email messages in a threaded format (among other things). Emails may come from any number of different mail clients, and in either text or HTML format.
Given that most people have a tendency to top post, I'd like to be able to hide the duplicated message in an email rep...
Hi, everyone, i've got below function to return true if input is badword
public bool isAdultKeyword(string input)
{
if (input == null || input.Length == 0)
{
return false;
}
else
{
Regex regex = new Regex(@"\b(badword1|badword2|anotherbadword)\b");
return regex.IsMatch(input);
}
}
above ...