473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Regular Expression Niggle

Hi there,

I'm using the following regex validator:

^\d{0,4}.?\d{0,2}$

This is to validate that a text box has 0-4 numbers, possible followed
by a decimal point and possibly followed by 2 decimal places.

For instance, the following are valid.......

0.45
200
3.89
..67
4667
255.98

etc. I've got it all working by handling all key-press events on the
text box apart from control keys and 0-9 plus the decimal point. On
pressing a key, I create a temp string and store the current text box
contents into it, then append the wanted number/decimal to the end and
apply the regex validator to it, handling the keypress if it doesn't
match. Got the regular expression working a treat too. I've got a lost
focus event on the text box, that auto applies a floating point format
with string.Format and {0:F}.

That all works fine too.

My only niggle is...............

The regex allows integer numbers of 5, 6 and 7 in length. I'd like to
stop this if I can but can't work it out - any ideas?!?

Ultimately, this isn't a MAJOR problem, but it'd be slick if I could
sort it. I was about to code all this out instead of using regex and
I've achieved in 3 lines what would have probably taken 50 or so! Spot
on.

Please help! Want to get this integrated into my work tomorrow!

Oct 5 '06 #1
11 1588
Make the decimal part a section in it's entirety, and make *that* the
zero-or-one; and shouldn't dot be escaped?

Haven't tested this, but how about

^\d{0,4}(\.\d{0,2})?$

Marc

Oct 6 '06 #2

Marc Gravell wrote:
Make the decimal part a section in it's entirety, and make *that* the
zero-or-one; and shouldn't dot be escaped?

Haven't tested this, but how about

^\d{0,4}(\.\d{0,2})?$

Marc
Ok thanks a lot - seems to make sense - I'll give it a go and post
back.

Cheers,
Mike.

Oct 6 '06 #3
In article <11**********************@m73g2000cwd.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: I'm using the following regex validator:
:
: ^\d{0,4}.?\d{0,2}$
:
: This is to validate that a text box has 0-4 numbers, possible followed
: by a decimal point and possibly followed by 2 decimal places.
: [...]

Be careful that you don't match the empty string or a string consisting
of only a dot.

I hope the code below helps:

using System;
using System.Text.RegularExpressions;

using MbUnit.Framework;

namespace num
{
public class NumberValidator
{
static Regex valid =
new Regex(@"^\d{1,4}(\.\d{0,2})?$|^\.\d\d?$");

public bool IsValid(string s)
{
return valid.IsMatch(s);
}
}

[TestFixture]
public class Test
{
[RowTest]
[Row("", false)]
[Row("abc", false)]
[Row("12345", false)]
[Row("1", true)]
[Row("1.", true)]
[Row("1.9", true)]
[Row("1.98", true)]
[Row("1.987", false)]
[Row("12", true)]
[Row("12.", true)]
[Row("12.9", true)]
[Row("12.98", true)]
[Row("12.987", false)]
[Row("123", true)]
[Row("123.", true)]
[Row("123.9", true)]
[Row("123.98", true)]
[Row("123.987", false)]
[Row("1234", true)]
[Row("1234.", true)]
[Row("1234.9", true)]
[Row("1234.98", true)]
[Row("1234.987", false)]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row("200", true)]
[Row("3.89", true)]
[Row(".67", true)]
[Row("4667", true)]
[Row("255.98", true)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}
}
}

Enjoy,
Greg
--
Tyrant, this arrow was meant for your heart if I had hurt my son.
-- William Tell, when asked why he had two arrows
Oct 6 '06 #4

Greg Bacon wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: I'm using the following regex validator:
:
: ^\d{0,4}.?\d{0,2}$
:
: This is to validate that a text box has 0-4 numbers, possible followed
: by a decimal point and possibly followed by 2 decimal places.
: [...]

Be careful that you don't match the empty string or a string consisting
of only a dot.

I hope the code below helps:

using System;
using System.Text.RegularExpressions;

using MbUnit.Framework;

namespace num
{
public class NumberValidator
{
static Regex valid =
new Regex(@"^\d{1,4}(\.\d{0,2})?$|^\.\d\d?$");

public bool IsValid(string s)
{
return valid.IsMatch(s);
}
}

[TestFixture]
public class Test
{
[RowTest]
[Row("", false)]
[Row("abc", false)]
[Row("12345", false)]
[Row("1", true)]
[Row("1.", true)]
[Row("1.9", true)]
[Row("1.98", true)]
[Row("1.987", false)]
[Row("12", true)]
[Row("12.", true)]
[Row("12.9", true)]
[Row("12.98", true)]
[Row("12.987", false)]
[Row("123", true)]
[Row("123.", true)]
[Row("123.9", true)]
[Row("123.98", true)]
[Row("123.987", false)]
[Row("1234", true)]
[Row("1234.", true)]
[Row("1234.9", true)]
[Row("1234.98", true)]
[Row("1234.987", false)]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row("200", true)]
[Row("3.89", true)]
[Row(".67", true)]
[Row("4667", true)]
[Row("255.98", true)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}
}
}

Enjoy,
Greg
--
Tyrant, this arrow was meant for your heart if I had hurt my son.
-- William Tell, when asked why he had two arrows
Top stuff - that is VERY nearly perfect, however entering a '.' first
is valid.

For instance .67 is valid. I have a lost focus event that applies a
{0:F} string format to it, so .67 would result in 0.67.

Other than that looks spot on!

I also check for string.Empty on my lost focus event!

Oct 6 '06 #5

Michael_Burgess wrote:
Greg Bacon wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: I'm using the following regex validator:
:
: ^\d{0,4}.?\d{0,2}$
:
: This is to validate that a text box has 0-4 numbers, possible followed
: by a decimal point and possibly followed by 2 decimal places.
: [...]

Be careful that you don't match the empty string or a string consisting
of only a dot.

I hope the code below helps:

using System;
using System.Text.RegularExpressions;

using MbUnit.Framework;

namespace num
{
public class NumberValidator
{
static Regex valid =
new Regex(@"^\d{1,4}(\.\d{0,2})?$|^\.\d\d?$");

public bool IsValid(string s)
{
return valid.IsMatch(s);
}
}

[TestFixture]
public class Test
{
[RowTest]
[Row("", false)]
[Row("abc", false)]
[Row("12345", false)]
[Row("1", true)]
[Row("1.", true)]
[Row("1.9", true)]
[Row("1.98", true)]
[Row("1.987", false)]
[Row("12", true)]
[Row("12.", true)]
[Row("12.9", true)]
[Row("12.98", true)]
[Row("12.987", false)]
[Row("123", true)]
[Row("123.", true)]
[Row("123.9", true)]
[Row("123.98", true)]
[Row("123.987", false)]
[Row("1234", true)]
[Row("1234.", true)]
[Row("1234.9", true)]
[Row("1234.98", true)]
[Row("1234.987", false)]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row("200", true)]
[Row("3.89", true)]
[Row(".67", true)]
[Row("4667", true)]
[Row("255.98", true)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}
}
}

Enjoy,
Greg
--
Tyrant, this arrow was meant for your heart if I had hurt my son.
-- William Tell, when asked why he had two arrows

Top stuff - that is VERY nearly perfect, however entering a '.' first
is valid.

For instance .67 is valid. I have a lost focus event that applies a
{0:F} string format to it, so .67 would result in 0.67.

Other than that looks spot on!

I also check for string.Empty on my lost focus event!
^\d{0,4}(\.\d{0,2})?$|^\.\d\d?$

Seems to do the job perfectly.

No doubt a live user will manage to break it and bomb the system, but
I'll slam plenty of error handling in and wait and see! Any help then
on what the part after the vertical bar means?

First part makes sense, but ^\.\d\d?$ is new to me - it's obviously
doing another input mask on another string, but I can't work out what
it adds (it must do something, as now it stops entry at 4 characters
before the first decimal!).

Cheers,
Mike.

Oct 6 '06 #6
^\.\d\d?$ is new to me

First - I'll happily grant it is closer than my effort! But:
^\d{0,4}(\.\d{0,2})?$|^\.\d\d?$
The latter catches ".4", ".05", etc - i.e starts with dot then a digit,
then (optionally) a digit, then ends.

However, unless I am mistaken the former will already handle these, due
to {0,4}; perhaps this should be {1,4}??, i.e. between 1 and 4 digits,
then (optionally) a point, and up to 2 more digits, then ends.

Marc

Oct 6 '06 #7

Michael_Burgess wrote:
Michael_Burgess wrote:
Greg Bacon wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:
>
: I'm using the following regex validator:
:
: ^\d{0,4}.?\d{0,2}$
:
: This is to validate that a text box has 0-4 numbers, possible followed
: by a decimal point and possibly followed by 2 decimal places.
: [...]
>
Be careful that you don't match the empty string or a string consisting
of only a dot.
>
I hope the code below helps:
>
using System;
using System.Text.RegularExpressions;
>
using MbUnit.Framework;
>
namespace num
{
public class NumberValidator
{
static Regex valid =
new Regex(@"^\d{1,4}(\.\d{0,2})?$|^\.\d\d?$");
>
public bool IsValid(string s)
{
return valid.IsMatch(s);
}
}
>
[TestFixture]
public class Test
{
[RowTest]
[Row("", false)]
[Row("abc", false)]
[Row("12345", false)]
[Row("1", true)]
[Row("1.", true)]
[Row("1.9", true)]
[Row("1.98", true)]
[Row("1.987", false)]
[Row("12", true)]
[Row("12.", true)]
[Row("12.9", true)]
[Row("12.98", true)]
[Row("12.987", false)]
[Row("123", true)]
[Row("123.", true)]
[Row("123.9", true)]
[Row("123.98", true)]
[Row("123.987", false)]
[Row("1234", true)]
[Row("1234.", true)]
[Row("1234.9", true)]
[Row("1234.98", true)]
[Row("1234.987", false)]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row("200", true)]
[Row("3.89", true)]
[Row(".67", true)]
[Row("4667", true)]
[Row("255.98", true)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}
}
}
>
Enjoy,
Greg
--
Tyrant, this arrow was meant for your heart if I had hurt my son.
-- William Tell, when asked why he had two arrows
Top stuff - that is VERY nearly perfect, however entering a '.' first
is valid.

For instance .67 is valid. I have a lost focus event that applies a
{0:F} string format to it, so .67 would result in 0.67.

Other than that looks spot on!

I also check for string.Empty on my lost focus event!

^\d{0,4}(\.\d{0,2})?$|^\.\d\d?$

Seems to do the job perfectly.

No doubt a live user will manage to break it and bomb the system, but
I'll slam plenty of error handling in and wait and see! Any help then
on what the part after the vertical bar means?

First part makes sense, but ^\.\d\d?$ is new to me - it's obviously
doing another input mask on another string, but I can't work out what
it adds (it must do something, as now it stops entry at 4 characters
before the first decimal!).

Cheers,
Mike.
Had to put some code in lost focus that checks for just a '.' on its
own to stop it trying to cast that to a decimal.

Nothing I can do about that one - if a user started to enter .67 for
instance and tabbed off after ',' then there is bugger all I can do
about that other than handle it.

I've chosen to nibble the decimal if that happens. They might think
'where's it gone?' - but it'll teach them to leave duff data in my
fields!

Oct 6 '06 #8

Michael_Burgess wrote:
Michael_Burgess wrote:
Michael_Burgess wrote:
Greg Bacon wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: I'm using the following regex validator:
:
: ^\d{0,4}.?\d{0,2}$
:
: This is to validate that a text box has 0-4 numbers, possible followed
: by a decimal point and possibly followed by 2 decimal places.
: [...]

Be careful that you don't match the empty string or a string consisting
of only a dot.

I hope the code below helps:

using System;
using System.Text.RegularExpressions;

using MbUnit.Framework;

namespace num
{
public class NumberValidator
{
static Regex valid =
new Regex(@"^\d{1,4}(\.\d{0,2})?$|^\.\d\d?$");

public bool IsValid(string s)
{
return valid.IsMatch(s);
}
}

[TestFixture]
public class Test
{
[RowTest]
[Row("", false)]
[Row("abc", false)]
[Row("12345", false)]
[Row("1", true)]
[Row("1.", true)]
[Row("1.9", true)]
[Row("1.98", true)]
[Row("1.987", false)]
[Row("12", true)]
[Row("12.", true)]
[Row("12.9", true)]
[Row("12.98", true)]
[Row("12.987", false)]
[Row("123", true)]
[Row("123.", true)]
[Row("123.9", true)]
[Row("123.98", true)]
[Row("123.987", false)]
[Row("1234", true)]
[Row("1234.", true)]
[Row("1234.9", true)]
[Row("1234.98", true)]
[Row("1234.987", false)]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row("200", true)]
[Row("3.89", true)]
[Row(".67", true)]
[Row("4667", true)]
[Row("255.98", true)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}
}
}

Enjoy,
Greg
--
Tyrant, this arrow was meant for your heart if I had hurt my son.
-- William Tell, when asked why he had two arrows
>
Top stuff - that is VERY nearly perfect, however entering a '.' first
is valid.
>
For instance .67 is valid. I have a lost focus event that applies a
{0:F} string format to it, so .67 would result in 0.67.
>
Other than that looks spot on!
>
I also check for string.Empty on my lost focus event!
^\d{0,4}(\.\d{0,2})?$|^\.\d\d?$

Seems to do the job perfectly.

No doubt a live user will manage to break it and bomb the system, but
I'll slam plenty of error handling in and wait and see! Any help then
on what the part after the vertical bar means?

First part makes sense, but ^\.\d\d?$ is new to me - it's obviously
doing another input mask on another string, but I can't work out what
it adds (it must do something, as now it stops entry at 4 characters
before the first decimal!).

Cheers,
Mike.

Had to put some code in lost focus that checks for just a '.' on its
own to stop it trying to cast that to a decimal.

Nothing I can do about that one - if a user started to enter .67 for
instance and tabbed off after ',' then there is bugger all I can do
about that other than handle it.

I've chosen to nibble the decimal if that happens. They might think
'where's it gone?' - but it'll teach them to leave duff data in my
fields!
Can anyone think of a more graceful way of dealing with just a '.' ?

I can't let that get past presentation - I could always just not format
it on the lost focus event and then on the 'OK' button click event
throw a validation error and force focus on that field?

Oct 7 '06 #9
In article <11**********************@b28g2000cwb.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: Top stuff - that is VERY nearly perfect, however entering a '.' first
: is valid.
:
: For instance .67 is valid. I have a lost focus event that applies a
: {0:F} string format to it, so .67 would result in 0.67.
:
: Other than that looks spot on!

If you aren't familiar with MbUnit and especially its RowTest
attribute, see

http://www.mertner.com/confluence/di...wTestAttribute

Let's use a smaller set of cases:

[RowTest]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row(".67", true)]
[Row("", false)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}

The MbUnit framework runs CheckString runs once for each Row attribute.
For a given Row, the values of num and isValid are the values of the
first and second parameters respectively. For example, the first row
results in the following call:

CheckString(".1", true);

Think of the row attributes as encoding our expectations in a table:

Input Valid?
----- ------
".1" true
".12" true
".123" false
"." false
"0.45" true
".67" true
"" false

If an actual result doesn't match the expectation, then that test
case fails. (All the tests passed before I posted, BTW. :-)

So the pattern I gave correctly recognizes ".67".

: I also check for string.Empty on my lost focus event!

No need: that case is already covered too!

Hope this helps,
Greg
--
So maybe the government beancounters are right to cut back on fireworks. But
it just doesn't seem right. And besides, we suspect that most taxpayers would
rather pay for a bad fireworks display than a good congressman.
-- Eric Fry, "The Daily Reckoning" - 2003/06/03
Oct 9 '06 #10

Greg Bacon wrote:
In article <11**********************@b28g2000cwb.googlegroups .com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: Top stuff - that is VERY nearly perfect, however entering a '.' first
: is valid.
:
: For instance .67 is valid. I have a lost focus event that applies a
: {0:F} string format to it, so .67 would result in 0.67.
:
: Other than that looks spot on!

If you aren't familiar with MbUnit and especially its RowTest
attribute, see

http://www.mertner.com/confluence/di...wTestAttribute

Let's use a smaller set of cases:

[RowTest]
[Row(".1", true)]
[Row(".12", true)]
[Row(".123", false)]
[Row(".", false)]
[Row("0.45", true)]
[Row(".67", true)]
[Row("", false)]
public void CheckString(string num, bool isValid)
{
NumberValidator check = new NumberValidator();
Assert.AreEqual(isValid, check.IsValid(num));
}

The MbUnit framework runs CheckString runs once for each Row attribute.
For a given Row, the values of num and isValid are the values of the
first and second parameters respectively. For example, the first row
results in the following call:

CheckString(".1", true);

Think of the row attributes as encoding our expectations in a table:

Input Valid?
----- ------
".1" true
".12" true
".123" false
"." false
"0.45" true
".67" true
"" false

If an actual result doesn't match the expectation, then that test
case fails. (All the tests passed before I posted, BTW. :-)

So the pattern I gave correctly recognizes ".67".

: I also check for string.Empty on my lost focus event!

No need: that case is already covered too!

Hope this helps,
Greg
--
So maybe the government beancounters are right to cut back on fireworks. But
it just doesn't seem right. And besides, we suspect that most taxpayers would
rather pay for a bad fireworks display than a good congressman.
-- Eric Fry, "The Daily Reckoning" - 2003/06/03
Hi Greg,

Thanks for the reply. I use NUnit so I'm familiar with assertions and
general unit testing principles.

Although your tests show '.' as being an invalid string, the user can
still enter just that (they could start to write '.67' and tab off the
field after a '.'. That's why I was wondering if there was a way of
stopping that being entered, but I really don't think there is, so I'll
just stick to doing some checks on lost focus. The same applies to the
empty string. Although when run through a unit test the
assertion.equals(false, regex_result) would return true, when talking
about actual presentation on a screen, the user can click into the
field and tab off without typing anything in, providing the need for
some more checks on lost focus.

I have some defailt validation messages for the screen and can alert
the users that way.

I'm very happy with the regex mask now though. Does a cracking job.
Thanks!

Oct 9 '06 #11
In article <11**********************@i3g2000cwc.googlegroups. com>,
Michael_Burgess <mi**@marsh-hall-studios.co.ukwrote:

: Although your tests show '.' as being an invalid string, the user can
: still enter just that (they could start to write '.67' and tab off the
: field after a '.'. That's why I was wondering if there was a way of
: stopping that being entered, but I really don't think there is, so I'll
: just stick to doing some checks on lost focus. The same applies to the
: empty string. Although when run through a unit test the
: assertion.equals(false, regex_result) would return true, when talking
: about actual presentation on a screen, the user can click into the
: field and tab off without typing anything in, providing the need for
: some more checks on lost focus.
:
: I have some defailt validation messages for the screen and can alert
: the users that way.
:
: I'm very happy with the regex mask now though. Does a cracking job.
: Thanks!

Yeah, it'd be nice to be able to use regular expressions for validating
each keystroke, but the entire pattern has to match: we don't have
continuations or a NotYetFailed property.

I once worked on an interface that validated real-number inputs at
each keystroke. I constructed a state machine that recognizes valid
inputs. I walked through the transitions for the input and only
reported failure if I fell into the fail state. In other words, I
matched all possible left-substrings of possible matches.

The NFA for your language is straightforward:

\d \d \d \d
-----( ) -----(( )) -----(( )) -----(( )) -----(( ))
| | | | |
. | . | . | . | . |
| | | | |
| +------------+------------+------------+
| |
| |
| V
| (( ))
| |
| |
| |
| \d V \d
( ) -----(( )) -----(( ))

Here I'm using "(( ))" to denote accept states.

Then you simply number the states and encode the transitions in a
table. Remember there's an implied trap state that catches invalid
inputs. Call the trap state 0 and number the rest in top-to-bottom,
left-to-right order. Your table looks something like

static readonly int[,] delta = new int[,] {
// 0 1 2 3 4 5 6 7 8 9 .
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } // trap
{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7 } // start

// ...
}

You'd refuse the next keystroke if there's no transition for it.
You know you have a good input if after you've exhaused the input
the current state is an accept state.

Drawing the state machine is the most challenging part. Walking the
transitions is a simple loop with a table lookup.

It worked out nicely, and it made for nice error prevention in the
interface.

Hope this helps,
Greg
--
George Bush II will be remembered as a great state-building liberal on
the scale of Wilson, FDR, and Nixon. Ah, the Republican Party: the
great friend of free enterprise and individual rights.
-- Joseph R. Stromberg
Oct 9 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
4
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
3
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
1
by: Allan Ebdrup | last post by:
I have a dynamic list of regular expressions, the expressions don't change very often but they can change. And I have a single string that I want to match the regular expressions against and find...
1
by: NvrBst | last post by:
I want to use the .replace() method with the regular expression /^ %VAR % =,($|&)/. The following DOESN'T replace the "^default.aspx=,($|&)" regular expression with "":...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
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...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.