|
No. Copy'n'paste the relevant code fragments.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi, sorry for the delayed response.
I wanted to show you a screenshot, because I'm not getting an error from the application I'm using. It's replacing the string with [A-Za-z]{3}(?=\d{4})
Let me know if you can see the screenshot from the link below?
regmagic2.png - Google Drive[^]
|
|
|
|
|
And what do you think that tells me about how you coded it?
To quote myself:
Quote: And how - exactly - did you try it?
If you go for a drive and break down, when you call the garage, do you send them a picture of the view you can see out the car window? Or tell them what happened and where you are?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I dont understand.
Did you see the screenshot?
I simply cut-and-paste your regex
I should point out the regex I originally sent was not generated by me - I simply got the regex using an application called RegexMagic.
I am 100% new to Regex.
This means, I really don't have a clue what you're referring to.
Please help
|
|
|
|
|
Code.
A regex doesn't exist in isolation - it has to be used in code in order to do anything. On it's own, it's just a string ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What does it take to get you to copy and paste the code you're using where you're setting up and using this RegEx?
|
|
|
|
|
Hi Dave,
Sorry for the delayed response
The reason for wanting to show a screenshot is because I use application to insert the a Search and Replace regex. So I would enter [A-Za-z]{3}\d{4} in the Search dialogue box, and [A-Za-z]{3}(?=\d{4}) in the replace dialoge box.
The search regex works fine, but the replace regex returns [A-Za-z]{3}(?=\d{4})
I'm assuming the the Regex pattern HTML 5 FireFox doesn't allow for replace?
|
|
|
|
|
You're making a lot of baseless assumptions and STILL not providing what is needed to solve the problem.
|
|
|
|
|
Dave,
I'm not sure I could be any clearer.
If you looked at the image you would see exactly what happens when I insert the Regex
|
|
|
|
|
Never heard of DataCleaner. Don't use it and not going to start.
If it's some tool you found somewhere, your best source of support is going to be whoever wrote it.
Your BIGGEST mistake was never telling anyone you were using some tool to do this work instead of writing your own code to do it.
|
|
|
|
|
Hi Community,
I have come to the conclusion that it may not to be possible to change the case of a string in JAVA 8 as simply as it is to change the case in say Perl.
However, before I move on, I just wanted to have someone on this forum confirm its not possible to change the case in JAVA 8 as follows:
Insert the whole regex match or the 1st through 99th backreference with the first letter of each word in the matched text converted to uppercase and the remaining letters converted to lowercase.
Example
Replacing .+ with \I0 in HeLlO WoRlD yields Hello World
Can someone confirm that the above isn't possible with JAVA 8?
If its not possible, can someone let me know how to achieve the above with JAVA 8?
Thanks
|
|
|
|
|
I suggested to you last week that it would be easier to use string functions to do what you want. Convert the entire string to lower case, then find each word beginning and convert the single letter to upper case.
|
|
|
|
|
Hey Richard,
I was so fixated with the way I wanted to achieve the result that I didn't realise how easy it is to get the result using your suggestion. TBH, with your suggestion I can get the result just using SQL, converting the entire string to lower case (as you suggested) and using a simple SQL function (which I'm familiar with) to Capitalize each word.
I literally would have saved myself 9 hours of trying to figure this out.
Thanks man
|
|
|
|
|
|
[S1.E2] The Series Name - The Episod Name
To look like this:
The.Series.Name.S01E02.The.Episod.Name.
Not matching with tvdb will say, if it did, it had been easy
Thanks for helping =)
|
|
|
|
|
Adding the leading zeroes with only a Regular Expression replacement may prove difficult.
If you're trying to match the two formats, it may be better to convert the other way.
What are you really trying to do?
modified 25-Dec-20 1:52am.
|
|
|
|
|
Can someone assist with a regular expression that will replace and capitalize the first character in a text characters to lowercase
For example
PETER Before
Peter After
JohN Before
John After
paul Before
Paul After
The following Regex will locate the Uppercase characters
[A-Z]
But I don't know how to replace them by turning the first character to Uppercase.
Thanks
|
|
|
|
|
You are probably better off using one of the many methods available with the String type. But since you have not identified which language you are using, that is something of a guess.
|
|
|
|
|
Hi,
Thanks for reaching out.
Sorry for not mentioning the language.
The language is JAVA 8
|
|
|
|
|
|
Hi Richard,
Thanks for reaching out.
And thanks for the link.
Unfortunately, I'm extremely new to Regex so unfortunately I wouldn't know where to look in the link
String (Java Platform SE 7 )[^]
I thought this was a pretty easy question for someone help with an answer to?
|
|
|
|
|
The String class has nothing to do with Regexes. You use it to quickly convert all characters to lower case. You can then find some method to capitalise the first letter of each word.
|
|
|
|
|
Hi Richard,
Sorry to be pain, but could please provide an example
|
|
|
|
|
I have a better idea. Think about what you are trying to do and work out which methods are likely to help you. You will learn far more by trying things yourself.
|
|
|
|
|
ok, I will think of something.
I will post it. Hopefully, you'll let me know if I'm on the right track
|
|
|
|