VS 2008 - Regular Expression Remove Brackets And Its Content

Oct 18, 2010

I have a string, for example "lol [-wow-] lol".
I would like to remove the brackets and the content to have something like "lol lol".

View 6 Replies


ADVERTISEMENT

Regular Expression To Return A String In Between Two Brackets

Mar 19, 2009

Ok - this may seem like a strange request ... but basically I need a regular expression to return a string in between two brackets as described below... String:

[Code]....

View 1 Replies

Regular Expression Does Not Remove HTML Comment?

Jun 30, 2011

I have the following string:
<TD><!-- 1.91 -->6949<!-- 9.11 --></TD>
I want to end up with:
<TD>6949/TD>
But instead I end up with just the tags and no information:
<TD></TD>

This is the regular expression I am using:
RegEx.Replace("<TD><!-- 1.91 -->6949<!-- 9.11 --></TD>","<!--.*-->","")
How to keep the numbers and remove just what the comments.

View 3 Replies

Regex Regular Expression To Remove Lines Which Start With Certain Text?

Mar 24, 2012

I know it may be quite easily for you. i have a text which contains 40 lines, I want to remove lines which starts with a constant text. check below data.

When I used (?mn)[+CMGL:].*($) it removes the whole text , when I use (?mn)[+CMGL:].*(
) , it only leaves the first line.
+CMGL: 0,1,,159
07910201956905F0440B910201532762F20008709021225282808
+CMGL: 1,1,,159

[Code]...

View 1 Replies

C# - Regular Expression - Remove HTML Comment Spanning Multiple Line Breaks?

May 18, 2012

I'm using this script:

http:[url].....To convert some outlook HTML to plain text.It nearly works, the only thing that it leaves behind is the CSS which outlook places in html comment tags <!-- --> in addition to <style> tags (which are removed).This is the original text:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">[code].....

View 1 Replies

VS 2008 Regular Expression Underscore?

Mar 8, 2011

I have a string that likes 1234_a34_b789 There are at least two "_" in the string. It cann't be the first or last letter. What is the regular expression pattern?

View 7 Replies

VS 2008 Regular Expression Does Not Find Anything If I Use ( Or ) Marks?

Dec 2, 2009

Dim RX As New System.Text.RegularExpressions.Regex("(?<=" & TextBox1.Text & "</a></td>s<td>).+?(?=</td>)", System.Text.RegularExpressions.RegexOptions.IgnoreCase)

If textbox includes ( or ) it does not find anything? (Using them at text box)What would be reason for that?

View 6 Replies

VS 2008 Regular Expression Error, Because Letter Is Not Uppercase

Dec 2, 2009

How do i can make my Regular Expression find word without taking a care is it big or small letter?

View 8 Replies

VS 2008 Use Regular Expression To Count Occurrence Of Purpose

Dec 1, 2011

I need to count the number of:

[Code]...

Can Regular Expression be used of this purpose? It's okay if they're in separate function, but I need to somehow get the counts of each of the above.

View 1 Replies

Ignore Curly Brackets In Regex Expression

Nov 14, 2011

I am trying to build an application which does the following :

1) write some text in a richtextbox

2) when user clicks a button, the app will replace the text with another text in {} braces.

what I want is that the next time, the regex searches for any text it should exclude those which are present in {}. for eg : my world is good world and a happy world and will be a better world for everyone. first pass - change word "world"

[Code]....

View 1 Replies

Remove The Brackets From A String?

Apr 25, 2010

How do i remove the brackets from a string that looks like this:

[anything inside here]??

I would like to do it in one line of code

View 2 Replies

C# - Remove Square Brackets And Single Quotes Regex Not Working

May 9, 2011

I have the following string [custID] = 'A99999999' I am trying the following to remove the square brackets and the single quotes Regex.Replace(sql, "/[[]']+/g", " ") but that's not working. I keep getting the same results Note: sql is a variable holding the string above. I want the result to be

View 5 Replies

Regular Expression In .Net?

Oct 21, 2011

Regular Expression to count per words and characters in VB.Net. Here's my codes.

[Code]...

View 4 Replies

Correctness Of A Regular Expression

Oct 7, 2011

I'm trying to create a regex which will match either one of the following [code] This regex is supposed to return all and any form of the function that is used.If match string were - FVAL(A,"B")+5 then match group should be FVAL(A,"B")

View 1 Replies

.net - Regular Expression Works In VB But Not C#

May 19, 2009

I have the following regular expression for validating a file name:

^(([a-zA-Z]:|))?(((.)|(..)|(. %5D">^/:*?"|<>. |([^/:*?"|<>][^/:*?"|<>. ]))?))). %5D">^/:*?"|<>. |([^/:*?"|<>]*[^/:*?"|<>. ]))?$

I can get it to work in VB.NET but not C#. I can't figure out why it works in one but not the other.

[Code]...

As far as I can tell the patterns are identical in both languages with escaping. When I run the VB code I get a match. When I run the C# code I get nothing.

View 1 Replies

C# - How Optimise The Regular Expression

Oct 14, 2010

I have just coded the below regular expression. I have a mini rich text editor on a web page (very similar to the one I am using to post this question) and I want to make use of a double asterisk to indicate which words/phrases should be wrapped in a strong tag. The aim is to allow the user to add pre-defined HTML elements without actually having to submit HTML.
[code...]

Maybe I am over-optimising this, but I want to know if this can be made more efficient?

View 1 Replies

Create A Regular Expression?

Feb 12, 2009

It is a little like a search and replace, I want to replace any string that contains any substring in parentheses with the same string but the words in parentheses colored RED: Eg

Take this text in TextBox1:

"The Prime Minister (that idiot from Scotland) made a speech today"

and convert to this text in RichTextBox1:

"The Prime Minister (that idiot from Scotland) made a speech today"

View 1 Replies

Regular Expression - Parses Out Value

May 6, 2012

I had a regular expression which parses out value.

[Code]...

View 7 Replies

Regular Expression To Locate The Url In VB?

Oct 6, 2011

I am trying to use regular expression for extracting data from web page. but everytime i change the URL i need to change my regular expression for URL.

View 3 Replies

Regular Expression To Parse Xml In .net?

Mar 24, 2010

I have the following function that I am using to remove the characters �4 and nulls from my xmlString but I can't find what do I need to change to avoid removing the from my ending tags. This is what I get when I run this function

<ARR>20080625<ARR><DEP>20110606<DEP><PCIID>626783<PCIID><NOPAX>1<NOPAX><TG><TG><HASPREV>FALSE<HASPREV><HASSUCC>FALSE<HASSUCC>

find out what do I need to change in my expression to keep the ending tag as </tag>

[Code]...

View 1 Replies

Regular Expression Validator In Vb?

May 17, 2011

I have a textbox which takes as input the email address. Do you have regular expression validator in vb.net so that I can check if '@' is present or not in the string

View 2 Replies

Regular Expression With Filename?

Feb 1, 2012

I have a string (can be anything) and somewhere in the middle of the string there's a filename with the extension 'txt'. The filename can basically be anything, and any filename is correct, but with a certain exception.

If the filename ends with .part<number>.txt, the <number> can only be one of the following, 1, 01, 001, 0001.

Every other <number> is incorrect.

Match
.part1.txt
.Part001.txt

[Code].....

View 2 Replies

.net - Extract A Particular Value From An INI File Using A Regular Expression?

Dec 22, 2009

I want to extract a URL value from an INI File as such:

[DEFAULT]
BASEURL=http://www.stackoverflow.com/
[InternetShortcut]
URL=http://www.stackoverflow.com/

So I can get the URL value as the only Match from the Regular expression - but I don't understand enough about them (yet) to do this. I have seen RegEx examples that will parse any INI file and get the Name, Value Pairs I just want to get the URL value only from a file no matter what else it contains. My aim is to have something like this:

Dim _pattern As New Text.RegularExpressions.Regex("RegEx")
Dim _url As String = _pattern.Match(iniContentString).Value

It seems simple but I cannot seem to create a specific case RegEx where I want everything from "URL=" to the vbCrLf at the End to be my "Match". I have refered to Regular-Expressions.info which has been a help before but still cannot get this simple example to work.

View 1 Replies

.NET Regular Expression For Time 24 Hr Format?

Sep 1, 2009

have a regular expression in .NET, which will allow only 24 hr time format in the textbox.

View 6 Replies

Building A Dynamic Regular Expression?

Jun 12, 2009

I'm attempting to build a function that will return a regex that is dynamically created.The regex to create will be a range check between two numbers. So far I've got something similar to this (not finished as yet).Is this approach valid, or is there an easier way that I'm overlooking?

Public Shared Function Range(ByVal Minimum As Integer, ByVal Maximum As Integer) As String
Return "^([" & Minimum.ToString.PadLeft(2, "0") & "]" & Microsoft.VisualBasic.StrDup(Minimum.ToString.Length, "[0-9]") & "|2[0-4][0-9]|25[0-5])$"

[code]......

View 2 Replies

C# - Regular Expression For Domain Names

Apr 17, 2012

I am trying to validate a csv file of domain names (eg. @google.com, @xyz.co.uk, @xyz.edu etc.) I am using the following Regular Expression:
Regex(@"@(?:[a-zA-Z0-9-]+.)+[a-zA-Z]{2,4}$", RegexOptions.Compiled);
Is there scope for improvement on the above?

View 1 Replies

C# - Regular Expression For Valid Domains

Apr 17, 2012

Regex(@"@(?:[a-zA-Z0-9-]+.)+[a-zA-Z]{2,4}$", RegexOptions.Compiled);
Using the above, I want to pass only values like @gmail.com, @xyz.edu, @co.uk etc...
But I find that the values like abc@gmail.com (valid email ids) also pass through.

View 2 Replies

DateTimePicker - Invalid Regular Expression

Nov 11, 2009

I am using the below Regular Expression which works fine in case of date validation. But if I select the date from the DatePicket even then it throws alert:Enter valid date. How can I modify the regular expression so as to be compatible with DatePicker.

Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "^(((0?[1-9]|[12]d|3[01]).-/.-/?d{2}))|((0?[1-9]|[12]d|30).-/.-/?d{2}))|((0?[1-9]|1d|2[0-8])[.-/]0?2.-/?d{2}))|(29[.-/]0?2.-/?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))$"
.IgnoreCase = True
.Global = True
End With
[Code] .....

View 2 Replies

IDE :: Regular Expression Got Parsing The Html

Sep 15, 2006

get generic regular expression for my html file ....????? My html is....

[Code]...

View 2 Replies

Make The Regular Expression For Validations?

Jan 10, 2012

i'm trying to make the regular expression for validations, but I can't manage to get a control of the result I want.

I wanna input in a textbox the following :

(029)-234-2342342

Or what is the same, the ( ), 3 numbers inside, a "-", 3 numbers, another "-" and 7 numbers.

How can I manage it??

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved