I tried
Dim s As String = "1 2 3 4 5"
Regex.Replace(s, "3", "6")
but no luck, nothing was changed? 9 1334
<Lucio H> schrieb: I tried
Dim s As String = "1 2 3 4 5"
Regex.Replace(s, "3", "6")
\\\
s = Regex.Replace(s, "3", "6")
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
This was driving me crazy, thanks!!!
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OS**************@TK2MSFTNGP14.phx.gbl... <Lucio H> schrieb:I tried
Dim s As String = "1 2 3 4 5"
Regex.Replace(s, "3", "6")
\\\ s = Regex.Replace(s, "3", "6") ///
-- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Lucio,
Why not just Dim s As String = "1 2 3 4 5"
Regex.Replace(s, "3", "6")
s = Replace("3","6") it will not be a big time benefit, however there will
be probably a time benefit and describes in my idea at least better what you
want that the program does.
Just my idea
Cor
Hi Cor, the reason is that I was not really interested in the substitution
per se, I wanted to know how regex works, I am sure you are not
suggesting regex is an unusfull tool...
tnx.
--
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl... Lucio,
Why not just
Dim s As String = "1 2 3 4 5"
Regex.Replace(s, "3", "6") s = Replace("3","6") it will not be a big time benefit, however there will be probably a time benefit and describes in my idea at least better what you want that the program does.
Just my idea
Cor
<Lucio H> wrote in news:eA*************@TK2MSFTNGP15.phx.gbl: Hi Cor, the reason is that I was not really interested in the substitution per se, I wanted to know how regex works, I am sure you are not suggesting regex is an unusfull tool...
Ancient PERL proverb...
If you have a problem and require a regex to solve it, you now have two
problems.
All the best
Tim F
Lucio, Hi Cor, the reason is that I was not really interested in the substitution per se, I wanted to know how regex works, I am sure you are not suggesting regex is an unusfull tool...
No in general not, however for the sample from you it is.
It is useful there where the change is complex.
Cor
It seems regular expressions where easier in vi and perl, though
they didn't have unicode to contend with...
regex- i love it !!
"Tim Ferguson" <Fe********@softhome.net> wrote in message
news:Xn*****************************@207.46.248.16 ... <Lucio H> wrote in news:eA*************@TK2MSFTNGP15.phx.gbl:
Hi Cor, the reason is that I was not really interested in the substitution per se, I wanted to know how regex works, I am sure you are not suggesting regex is an unusfull tool...
Ancient PERL proverb...
If you have a problem and require a regex to solve it, you now have two problems.
All the best
Tim F This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Andrew Baker |
last post by:
I am trying to write a function which provides my users with a file
filter. The filter used to work just using the VB "Like" comparision,
but I can't find the equivilant in C#. I looked at...
|
by: Ada |
last post by:
i'm trying to use Regex to match a 4 number group pattern.
once a match is found, write it to RichTextBox in red.
test data:
This is my 4567 test data.
1234this is another line of data.
Here's...
|
by: bill tie |
last post by:
I'd appreciate it if you could advise.
1. How do I replace "\" (backslash) with anything?
2. Suppose I want to replace
(a) every occurrence of characters "a", "b", "c", "d" with "x",
(b)...
|
by: tshad |
last post by:
Is there a way to use Regex inside of a tag, such as asp:label?
I tried something like this but can't make it work:
<asp:label id="Phone" text=Regex.Replace('<%# Container.DataItem("Phone")...
|
by: vbmark |
last post by:
I'm new to RegEx in vb.net so I'm not sure how to do this.
I want to know if a string contains two minus signs "-". If there are two
then I want it to return TRUE.
I also need to know if the...
| |
by: Extremest |
last post by:
I have a huge regex setup going on. If I don't do each one by itself
instead of all in one it won't work for. Also would like to know if
there is a faster way tried to use string.replace with all...
|
by: Extremest |
last post by:
I am using this regex.
static Regex paranthesis = new Regex("(\\d*/\\d*)",
RegexOptions.IgnoreCase);
it should find everything between parenthesis that have some numbers
onyl then a forward...
|
by: Efi |
last post by:
Hello,
I am trying to capture empty lines, for example :
1. ABCDEF
2.
3. abcdef
I would like to capture line number 2.
I am using the following regex - new...
|
by: TtfnJohn |
last post by:
I have two small scripts that while on the surface should both work
the problem is they don't.
Here's the first one:
import re
testString = 'Thap,fpvi,*!wtyd@*.dip.t-dialin.net:*!ylx@*.dip.t-...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |