Hi,
I am looking for a regular expression for matching that contains no white space in between text but it may or may not have white space at start or end of text.
...
Hi,
I'm a complete n00b when it comes to regular expressions. I need these redirects:
(1)
www.mysite.com/bike.php?id=001&product=Product-Name&source=Source-Name
should become -> www.mysite.com/Source-Name/001-Product-Name
(2)
www.mysite.com/car.php?id=002&product=Product-Name&source=Source-Name
should become -> www.mysite.com/Sourc...
Hi,
This is the preg_match i am trying to use to find specific text in text file.
if (preg_match($regexp,$textFile,$result) > 0) {
echo "Found ".$result[0];
} else {
echo "Not found";
}
However, the result is always Found and nothing more. The result array is empty. Now i read that preg_match can't work with long strings.
My...
I tried to use Boost library but I failed, see my code:
#include "listy.h"
#include <boost/regex.hpp>
using namespace boost;
ListyCheck::ListyCheck() {
}
ListyCheck::~ListyCheck() {
}
bool ListyCheck::isValidItem(std::string &__item) {
regex e("(\\d{4}[- ]){3}\\d{4}");
return regex_match(__item, e);
}
When I tried to com...
Assume I have a Regex pattern I want to match many Strings to.
val Digit = """\d""".r
I just want to check whether a given String fully matches the Regex. What is a good and idiomatic way to do this in Scala?
I know that I can pattern match on Regexes, but this is syntactically not very pleasing in this case, because I have no groups...
An example of how the Strings may look:
TADE000177
TADE007,daFG
TADE0277 DFDFG
Thank you!
...
Hello,
I would like to sanitize a string in to a URL so this is what I basically need.
Everything must be removed except alphanumeric characters and spaces and dashed.
Spaces should be converter into dashes.
Eg.
This, is the URL!
must return
this-is-the-url
Thanks
...
I have a document that was converted from PDF to HTML for use on a company website to be referenced and indexed for search. I'm attempting to format the converted document to meet my needs and in doing so I am attempting to clean up some of the junk that was pulled over from when it was a PDF such as page numbers, headers, and footers. l...
When using a multi-line TextBox (AcceptsReturn="True") in Silverlight, line feeds are recorded as \r rather than \r\n. This is causing problems when the data is persisted and later exported to another format to be read by a Windows application.
I was thinking of using a regular expression to replace any single \r characters with a \r\n,...
I need to be able to catch when the URL contains a image of multiple file types or follow this syntax.
http://localhost:8080/fdlic-web/webpic/101
Here is what i have so far.
(.*)(jpg|gif|png|bmp|jpeg|webpic/(\d+))$
...
Hello,
I am trying to use regular expression to search a document fo a UUID number and replace the end of it with a new number. The code I have so far is:
read_file = open('test.txt', 'r+')
write_file = open('test.txt', 'w')
r = re.compile(r'(self.uid\s*=\s*5EFF837F-EFC2-4c32-A3D4\s*)(\S+)')
for l in read_file:
m1 = r.match(l)
...
I am trying to strip out all things that are in a string that are not a letter number or space so I created the regex
private static Regex _NonAlphaChars = new Regex("[^[A-Za-z0-9 ]]", RegexOptions.Compiled);
however When I call _NonAlphaChars.Replace("Scott,", ""); it returns "Scott,"
What am I doing wrong that it is not matching th...
So I am trying to read an XML file into a string in Perl and send it as part of a SOAP message. I know this is not ideal as there are methods for SOAP sending files, however, I am limited to having to use the SOAP that is set up, and it is not set up for sending with file support.
Therefore I need to parse out the markup tags <> and re...
I have the following sample set of data:
<p>first line\n
second line\n
third line\n</p>
first line\n
second line\n
third line\n
Using regex, how could I match on the newline characters, but only when they are within the paragraph tags.
This code would be used within php.
...
Hi,
I want a solution to validate only domain names not full urls, The following example is what i'm looking for:
domain.com -> true
domain.net/org/biz... -> true
domain.co.uk -> true
sub.domain.com -> true
domain.com/folder -> false
domµ*$ain.com -> false
Thank you
...
I need to find all substrings from a string that starting with a given string following with a left bracket and then any legal literal and then the right bracket. For example, a string is abcd(xyz)efcd(opq), I want to a function that returns "cd(xyz)" and "cd(opq)". I wrote a regular expression, but it returns only cd( and cd(...
...
I am using sed to extract parts of an XML I am interested in:
sed '/<car car_id="BMW" year="1999"/,/</car>/p' input
So what I really would like to get back is:
<car car_id="BMW" year="1999" color="blue> ... </car>
Instead I get back a bunch of other car elements.
...
Hi,
I would like to understand what the following code is doing. This logic is part of a routine to strip out html from the body of an email message.
mBBSREgEx.IgnoreCase = True
mBBSREgEx.Global = True
mBBSREgEx.Pattern = "<[^>]*>"
sResult = mBBSREgEx.Replace(sResult, "")
Thank you,
Jim
Ok, if I wanted to change the routine to stri...
Say you have a string: "The ABC cow jumped over XYZ the moon" and you want to use jQuery to get the substring between the "ABC" and "XYZ", how would you do this? The substring should be "cow jumped over". Many thanks!
...
With this string
http://sfsdf.com/sdfsdf-sdfsdf/sdf-as.html
I need to get sdf-as
with this
hellow-1/yo-sdf.html
I need yo-sdf
...