|
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
|
|
|
|
|
I'm never going to figure it out!
Can I get some hints on a solution?
|
|
|
|
|
So, this is my attempt
I tried the following regex in Java 8, (?i)(Helló) (Wórld) which matches HeLlÓ WóRlD the replacement string \U$1 \L$2 should become HELLÓ wórld, but it doesn't work.
Can someone please help me???
|
|
|
|
|
In C# (for example) there is no "proper case": one changes to "lower case", then uses "title case".
TextInfo.ToTitleCase(String) Method (System.Globalization) | Microsoft Docs
Quote: Converts the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Thanks getting in touch.
I'm using Java 8
Are you able help?
|
|
|
|
|
Hi
I'm a Regex novice (very much learning as I go!) and I am trying to write a regex expression to capture the minimum and maximum temperature values in the string below. I'm hoping someone may be able to help e see where I have gone wrong?
class="outsideimage m0200006341e8" title=""></td>
</tr>
<tr>
<th>Humidity</th>
<td>100%</td>
</tr>
<tr>
<th valign="top">Temp Min</th>
<td valign="top" class="mm">3.1°C</td>
</tr>
<tr>
<th valign="top">Temp Max</th>
<td valign="top" class="mm">5.7°C</td>
I have to include the m00006341e8 in the string to match as there are several other sensors that report in the overall text string and they all have a different serial number. I need to just extract the max and min values for this particular sensor. I think I've allowed for the fact that the humidity value may change
I have tried the following, but it doesn't seem to be working:
For the minimum temperature:
class="outsideimage m0200006341e8" title=""></td></tr><tr><th>Humidity</th><td>[0-9]*\%</td></tr><tr><th valign="top">Temp Min</th><td valign="top" class="mm">([-]?[0-9]*[.]?[0-9]?)
and for the maximum temperature:
class="outsideimage m0200006341e8" title=""></td></tr><tr><th>Humidity</th><td>[0-9]*\%</td></tr><tr><th valign="top">Temp Min</th><td valign="top" class="mm">[-]?[0-9]*[.]?[0-9]?°C</td></tr><tr><th valign="top">Temp Max</th><td valign="top" class="mm">([-]?[0-9]*[.]?[0-9]?)°C</td>
|
|
|
|