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;
}







0















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})









share|improve this question









New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • 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


















0















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})









share|improve this question









New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • 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














0












0








0








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})









share|improve this question









New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago







morethanyell













New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









morethanyellmorethanyell

32




32




New contributor




morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






morethanyell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • 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











  • 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










2 Answers
2






active

oldest

votes


















0














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.






share|improve this answer
























  • wizzard! thank you very much.

    – morethanyell
    1 hour ago



















0















  1. It doesn’t make sense to say d{1}?
    You want to match one digit, or none, do just say d?.

  2. So you could use (.*)(d?,?d{3}.d{2})
    But that would match the 2019 in City2019.00
    (It would also match the ,243.56 in City,234.56,
    if you ever got malformed input like that.) 
    You want to match NNN.NN
    or N,NNN.NN
    you either have N, or you don’t. 
    So try (.*)((d,)?d{3}.d{2}),
    which makes d, (i.e., N,) a group
    and applies the ? to it.






share|improve this answer
























  • 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














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.










draft saved

draft discarded


















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









0














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.






share|improve this answer
























  • wizzard! thank you very much.

    – morethanyell
    1 hour ago
















0














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.






share|improve this answer
























  • wizzard! thank you very much.

    – morethanyell
    1 hour ago














0












0








0







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









FreddyFreddy

2735




2735













  • 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





wizzard! thank you very much.

– morethanyell
1 hour ago













0















  1. It doesn’t make sense to say d{1}?
    You want to match one digit, or none, do just say d?.

  2. So you could use (.*)(d?,?d{3}.d{2})
    But that would match the 2019 in City2019.00
    (It would also match the ,243.56 in City,234.56,
    if you ever got malformed input like that.) 
    You want to match NNN.NN
    or N,NNN.NN
    you either have N, or you don’t. 
    So try (.*)((d,)?d{3}.d{2}),
    which makes d, (i.e., N,) a group
    and applies the ? to it.






share|improve this answer
























  • 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


















0















  1. It doesn’t make sense to say d{1}?
    You want to match one digit, or none, do just say d?.

  2. So you could use (.*)(d?,?d{3}.d{2})
    But that would match the 2019 in City2019.00
    (It would also match the ,243.56 in City,234.56,
    if you ever got malformed input like that.) 
    You want to match NNN.NN
    or N,NNN.NN
    you either have N, or you don’t. 
    So try (.*)((d,)?d{3}.d{2}),
    which makes d, (i.e., N,) a group
    and applies the ? to it.






share|improve this answer
























  • 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
















0












0








0








  1. It doesn’t make sense to say d{1}?
    You want to match one digit, or none, do just say d?.

  2. So you could use (.*)(d?,?d{3}.d{2})
    But that would match the 2019 in City2019.00
    (It would also match the ,243.56 in City,234.56,
    if you ever got malformed input like that.) 
    You want to match NNN.NN
    or N,NNN.NN
    you either have N, or you don’t. 
    So try (.*)((d,)?d{3}.d{2}),
    which makes d, (i.e., N,) a group
    and applies the ? to it.






share|improve this answer














  1. It doesn’t make sense to say d{1}?
    You want to match one digit, or none, do just say d?.

  2. So you could use (.*)(d?,?d{3}.d{2})
    But that would match the 2019 in City2019.00
    (It would also match the ,243.56 in City,234.56,
    if you ever got malformed input like that.) 
    You want to match NNN.NN
    or N,NNN.NN
    you either have N, or you don’t. 
    So try (.*)((d,)?d{3}.d{2}),
    which makes d, (i.e., N,) a group
    and applies the ? to it.







share|improve this answer












share|improve this answer



share|improve this answer










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





















  • 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












morethanyell is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...