Hi,
Can anybody help me writting a regular expression to replace these characters with a empty string. Character list is given below.
public static char[] delimiters = { ' ', '\r', '\n', '?', '!', ';', '.', ',', '`', ':', '(', ')', '{', '}', '[', ']', '|', '\'', '\\', '~', '=', '@', '>', '<', '&', '%', '-', '/', '#' };
Thanks.
Subrat.
A frequent issue in code reviews is whether a numeric value should be hard-coded in the code or not. Does anyone know of a nice regular expression that can catch 'magic numbers' in code like:
int overDue = 30;
Money fee = new Money(5.25D);
without also getting a ton of false positives like for loop initialization code?
for (int i = 0; i < array.length; i++) {
}
can any one tell me regular expression for postalcode of Amsterdam, Netherlands for validation
EX. 1113 GJ
Postal code format according to Wikipedia (thanks to Pekka):
1011–1199 plus a literal suffix AA-ZZ,
e.g. 1012 PP
Sorry for the potentially dumb question but I am trying to pull together a regular expression that will allow:
A number with 1 or 2 numbers before a decimal point, and 0-6 numbers after the decimal point. However I also need to allow the field to be blank if so required.
Valid Examples
0.952321
1.20394
12.12
25
Blank
Invalid Examples
123.45678
1.1234567
Please can anyone help?
I need to be able to download some file from a regular site using my proxy server,
I already try this:
System.Net.WebClient client = new System.Net.WebClient();
client.Proxy = new WebProxy(ip, port);
client.DownloadFile(url);
but it's not works at all, I don't know what I missed,(without a proxy it works)
thanks,
Dani.
Related to my previous question, I have a string on the following format:
this {is} a [sample] string with [some] {special} words. [another one]
What is the regular expression to extract the words within either square or curly brackets, ie.
{is}
[sample]
[some]
{special}
[another one]
Note: In my use case, brackets cannot be nested. I would also like to keep the enclosing characters, so that I can tell the difference between them when processing the results.
I have texts like this one:
this is a text in [lang lang="en" ]english[/lang] or a text in [lang lang="en" ]spanish[/lang]
I need to substitute them for:
this is a text in <span lang="en">english </span> or a text in <span lang="es">spanish</span>
I need a regular expression, not a simple replace. The languages in the lang tag can be whatever.
I receive Date and time from CSV file
The received Date format is YYYMMDD (string) (there is no ":" ,"-","/" to
separate Year month and date).
The received time format is HH:MM (24 Hour clock).
I have to validate both so that (example) (i) 000011990 could be invalidated for date (ii) 77:90 could be
invalidated for time.
The question is ,
Regular expression is the right candidate for do so (or) is there any other way to achieve
it?
I have a HTML page and I want to fetch the result between two tags <b> and <BR>
<b>Defendants Name:</b>Donahue, Leah A <BR>
What is the regular expression to fetch the words between these two tags
Hello,
I would like a regular expression in this format. It Must match one of the following formats:
* (###)###-####
* ###-###-####
* ###.###.####
* ##########
Strip all whitespace. Make sure it's a valid phone number, then (if necessary) translate it to the first format listed above.
I have text that looks like:
My name is (Richard) and I cannot do
[whatever (Jack) can't do] and
(Robert) is the same way [unlike
(Betty)] thanks (Jill)
The goal is to search using a regular expression to find all parenthesized names that occur anywhere in the text BUT in-between any brackets.
So in the text above, the result I am looking for is:
Richard
Robert
Jill
Dear Masters! Is it possible to ensure, that only characters with codes between 0 and 255 will be accepted by regular expression, but all with the codes up to 256 not? Thank you!
I would like to turn this query to regular inline sql without using stored procedures
declare @nod hierarchyid
select @nod = DepartmentHierarchyNode
from Organisation
where DepartmentHierarchyNode = 0x6BDA
select *
from Organisation
where @nod.IsDescendantOf(DepartmentHierarchyNode) = 1
Is there a way to do it?
I am looking for a regular expression (or other method if there is such a thing) for detecting bounce email messages. So far I have been going through our unattended mail box and adding strings that I find into a regex. I figured someone would have something that is already complete rather than me re-inventing the wheel.
Here is an example of what I have so far:
/reason: 550|permanent fatal errors|Error 550|Action: Failed|Mailbox does not exist|Delivery to the following recipients failed/i
Hey everybody,
I am a novice TCL programmer.Here I go My 1st post with stackoverflow forum. I would like to write a regular expression that matches any & only the strings starts with character A and ends with B. Whatever the characters coming inbetween should be displayed. For instance AXIOMB as an input from the user which starts with A & end with character B. Here is my try regexp { (^A([C-Z]+)B$)} Thank you
Hello all
I got this question which asks me to figure out why is it foolish to write a regular expression for the language that consists of strings of 0's and 1's that are palindromes( they read the same backwards and forwards).
part 2 of the question says using any formal mechanism of your choice, show how it is possible to express the language that consists of strings of 0's and 1's that are palindromes?
Hello All,
I would like to use regular expression to extract only @patrick @michelle from the following sentence:
@patrick @michelle we having diner @home tonight do you want to join?
Note: @home should not be include in the result because, it is not at beginning of the sentence nor is followed by another @name.
Any solution, tip, comments will be really appreciated.
hi everyone. I can't seem to make my regular expression work.
I'd like to have some alpha text, no numbers, an underscore and then some more aplha text.
for example: blah_blah
I have an non-working example here
^[a-z][_][a-z]$
Thanks in advance people.
EDIT: I applogize, I'd like to enforce the use of all lower case.
What is the difference between boost::ref(i) and & i ? What are the situations where we cannot use regular references and have to go for boost::ref instead?
Hello,
I need a regular expression to parse a text, the text is a URL. The URL is
http://www.foo.com/bar/hello.txt.
I want to get rid of the hello.txt, the delimiter is the slash.
I would like to get http://www.foo.com/bar/
I'm trying to figure out the regular expression that will match any character that is not a letter or a number. So characters such as (,,@,£,() etc ...
Once found I want to replace it with a blank space.
Any advice.
Yes I know that xeons are meant for server use, require different motherboards and you can have more than one of them in a box. But technically how is a xeon processor itself different from a regular core 2 processor?
I'm trying to use regular expression to extract the comments in the heading of a file.
For example, the source code may look like:
//This is an example file.
//Please help me.
#include "test.h"
int main() //main function
{
...
}
What I want to extract from the code are the first two lines, i.e.
//This is an example file.
//Please help me.
Any idea?