Notepad++ REGEX 3 or 4 digits at the end of string Announcing the arrival of Valued Associate...
Russian equivalents of おしゃれは足元から (Every good outfit starts with the shoes)
What are some likely causes to domain member PC losing contact to domain controller?
Is it OK to use the testing sample to compare algorithms?
How to infer difference of population proportion between two groups when proportion is small?
What is the proper term for etching or digging of wall to hide conduit of cables
Is the time—manner—place ordering of adverbials an oversimplification?
Why not use the yoke to control yaw, as well as pitch and roll?
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
An isoperimetric-type inequality inside a cube
3D Masyu - A Die
How many time has Arya actually used Needle?
How do I say "this must not happen"?
Problem with display of presentation
How do Java 8 default methods hеlp with lambdas?
Is a copyright notice with a non-existent name be invalid?
Does the universe have a fixed centre of mass?
What does 丫 mean? 丫是什么意思?
How to make an animal which can only breed for a certain number of generations?
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
Plotting a Maclaurin series
Twin's vs. Twins'
How to achieve cat-like agility?
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
Table formatting with tabularx?
Notepad++ REGEX 3 or 4 digits at the end of string
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Matching only the first occurrence in a line with RegexRegular Expression Help Needed in Notepad++Parsing multi-line string to extract only matched linesHow to parse USER-AGENT field in http header using regex?How to remove characters from a matching string?Multiline find and replace wrapper with wildcard insideNotepad++ Regex find line pattern but only replace one lineAssertion in conditional regexNotepad++ Regex help requiredRemove all but one word in a line - Notepad++
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I want to match the amount of money that is at the very last portion of the string. Some amount of money are in thousands e.g. 1,200.00 and some are only hundreds, e.g. 450.95. The string looks like this "March6March7Globe-Gmovies3dTaguigCity320.00".
Once match, I want to replace the entire string by just the matching value. E.g.
March6March7Globe-Gmovies3dTaguigCity320.00
March6March7Globe-Gmovies3dTaguigCity1,320.00
becomes
320.00
1,320.00
Why is my pattern only matching the thousands matching and not the hundreds? Thanks.
Here's my pattern:
(.*)(d{1}?,?d{3}.d{2})
notepad++ regex
New contributor
add a comment |
I want to match the amount of money that is at the very last portion of the string. Some amount of money are in thousands e.g. 1,200.00 and some are only hundreds, e.g. 450.95. The string looks like this "March6March7Globe-Gmovies3dTaguigCity320.00".
Once match, I want to replace the entire string by just the matching value. E.g.
March6March7Globe-Gmovies3dTaguigCity320.00
March6March7Globe-Gmovies3dTaguigCity1,320.00
becomes
320.00
1,320.00
Why is my pattern only matching the thousands matching and not the hundreds? Thanks.
Here's my pattern:
(.*)(d{1}?,?d{3}.d{2})
notepad++ regex
New contributor
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago
add a comment |
I want to match the amount of money that is at the very last portion of the string. Some amount of money are in thousands e.g. 1,200.00 and some are only hundreds, e.g. 450.95. The string looks like this "March6March7Globe-Gmovies3dTaguigCity320.00".
Once match, I want to replace the entire string by just the matching value. E.g.
March6March7Globe-Gmovies3dTaguigCity320.00
March6March7Globe-Gmovies3dTaguigCity1,320.00
becomes
320.00
1,320.00
Why is my pattern only matching the thousands matching and not the hundreds? Thanks.
Here's my pattern:
(.*)(d{1}?,?d{3}.d{2})
notepad++ regex
New contributor
I want to match the amount of money that is at the very last portion of the string. Some amount of money are in thousands e.g. 1,200.00 and some are only hundreds, e.g. 450.95. The string looks like this "March6March7Globe-Gmovies3dTaguigCity320.00".
Once match, I want to replace the entire string by just the matching value. E.g.
March6March7Globe-Gmovies3dTaguigCity320.00
March6March7Globe-Gmovies3dTaguigCity1,320.00
becomes
320.00
1,320.00
Why is my pattern only matching the thousands matching and not the hundreds? Thanks.
Here's my pattern:
(.*)(d{1}?,?d{3}.d{2})
notepad++ regex
notepad++ regex
New contributor
New contributor
edited 3 hours ago
morethanyell
New contributor
asked 3 hours ago
morethanyellmorethanyell
32
32
New contributor
New contributor
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago
add a comment |
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Please try: (.*?)((d,)?d{3}.d{2})
Here, the (*.?)
is like (.*)
, but minimally (the shortest matching string).
The comma doesn't have to be escaped.
wizzard! thank you very much.
– morethanyell
1 hour ago
add a comment |
- It doesn’t make sense to say
d{1}?
.
You want to match one digit, or none, do just sayd?
. - So you could use
(.*)(d?,?d{3}.d{2})
.
But that would match the2019
inCity2019.00
.
(It would also match the,243.56
inCity,234.56
,
if you ever got malformed input like that.)
You want to matchNNN.NN
orN,NNN.NN
—
you either haveN,
or you don’t.
So try(.*)((d,)?d{3}.d{2})
,
which makesd,
(i.e.,N,
) a group
and applies the?
to it.
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
morethanyell is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1428081%2fnotepad-regex-3-or-4-digits-at-the-end-of-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please try: (.*?)((d,)?d{3}.d{2})
Here, the (*.?)
is like (.*)
, but minimally (the shortest matching string).
The comma doesn't have to be escaped.
wizzard! thank you very much.
– morethanyell
1 hour ago
add a comment |
Please try: (.*?)((d,)?d{3}.d{2})
Here, the (*.?)
is like (.*)
, but minimally (the shortest matching string).
The comma doesn't have to be escaped.
wizzard! thank you very much.
– morethanyell
1 hour ago
add a comment |
Please try: (.*?)((d,)?d{3}.d{2})
Here, the (*.?)
is like (.*)
, but minimally (the shortest matching string).
The comma doesn't have to be escaped.
Please try: (.*?)((d,)?d{3}.d{2})
Here, the (*.?)
is like (.*)
, but minimally (the shortest matching string).
The comma doesn't have to be escaped.
answered 1 hour ago
FreddyFreddy
2735
2735
wizzard! thank you very much.
– morethanyell
1 hour ago
add a comment |
wizzard! thank you very much.
– morethanyell
1 hour ago
wizzard! thank you very much.
– morethanyell
1 hour ago
wizzard! thank you very much.
– morethanyell
1 hour ago
add a comment |
- It doesn’t make sense to say
d{1}?
.
You want to match one digit, or none, do just sayd?
. - So you could use
(.*)(d?,?d{3}.d{2})
.
But that would match the2019
inCity2019.00
.
(It would also match the,243.56
inCity,234.56
,
if you ever got malformed input like that.)
You want to matchNNN.NN
orN,NNN.NN
—
you either haveN,
or you don’t.
So try(.*)((d,)?d{3}.d{2})
,
which makesd,
(i.e.,N,
) a group
and applies the?
to it.
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
add a comment |
- It doesn’t make sense to say
d{1}?
.
You want to match one digit, or none, do just sayd?
. - So you could use
(.*)(d?,?d{3}.d{2})
.
But that would match the2019
inCity2019.00
.
(It would also match the,243.56
inCity,234.56
,
if you ever got malformed input like that.)
You want to matchNNN.NN
orN,NNN.NN
—
you either haveN,
or you don’t.
So try(.*)((d,)?d{3}.d{2})
,
which makesd,
(i.e.,N,
) a group
and applies the?
to it.
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
add a comment |
- It doesn’t make sense to say
d{1}?
.
You want to match one digit, or none, do just sayd?
. - So you could use
(.*)(d?,?d{3}.d{2})
.
But that would match the2019
inCity2019.00
.
(It would also match the,243.56
inCity,234.56
,
if you ever got malformed input like that.)
You want to matchNNN.NN
orN,NNN.NN
—
you either haveN,
or you don’t.
So try(.*)((d,)?d{3}.d{2})
,
which makesd,
(i.e.,N,
) a group
and applies the?
to it.
- It doesn’t make sense to say
d{1}?
.
You want to match one digit, or none, do just sayd?
. - So you could use
(.*)(d?,?d{3}.d{2})
.
But that would match the2019
inCity2019.00
.
(It would also match the,243.56
inCity,234.56
,
if you ever got malformed input like that.)
You want to matchNNN.NN
orN,NNN.NN
—
you either haveN,
or you don’t.
So try(.*)((d,)?d{3}.d{2})
,
which makesd,
(i.e.,N,
) a group
and applies the?
to it.
answered 2 hours ago
ScottScott
16.2k113990
16.2k113990
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
add a comment |
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
Thanks @Scott. However, this fails to capture the 1,550.00 in April5April5AnnualMembershipFee1,550.00 and the 2,199.75 in March31April1ToysRUsUptownBgcMakati2,199.75
– morethanyell
1 hour ago
add a comment |
morethanyell is a new contributor. Be nice, and check out our Code of Conduct.
morethanyell is a new contributor. Be nice, and check out our Code of Conduct.
morethanyell is a new contributor. Be nice, and check out our Code of Conduct.
morethanyell is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1428081%2fnotepad-regex-3-or-4-digits-at-the-end-of-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What are you trying to do, and what is happening? Please do not respond in comments; edit your question to make it clearer and more complete. … … P.S. I see only two different patterns in your sample data: 1000 > N ≥ 100 and 10000 > N ≥ 1000. There’s no point in listing 27 examples if there are only two different cases.
– Scott
3 hours ago
Hi @Scott, I've edited my question. Thanks.
– morethanyell
3 hours ago