Skip to content
Advertisement

Tag: string

Regex match any of the words separated by slashes

I need to develop a validation pattern for catching any kind from: pdf/csv/xlsx select any separate word is simple: (pdf|csv|xlsx). However, I need to check that any combination with them separated by slash is fine as well. For example, correct flow: Incorrect: Answer You may use this regex: RegEx Demo

Check if string contains number after specific word [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 months ago. Improve this question can someone help me with string validation? I tried to find the solution, but none was satisfied. I have the

Get all possible matches in a regex match (In Java)?

I am using a regex to match few possible values in a string that coming with my objects, there I need to get all possible values that are matching from my string as below, If my string value is “This is the code ABC : xyz use for something”. Here is my code that I am using to extract matchers,

Splitting String by column with regex

This is a String I get as input, but I just need every column, starting with the second column, aka: 1 (second row) 2 and 1 (third row) 1 (fifth row) This String has no fixed size in how many lines there could be or how many columns (columns being split by one space). I think this is fairly easy

java – Set final fields with reflection in Constructor

I’m trying to make a multi-language app with messages inside multiple *.properties files. I’ve started working on something like this: Now, there’s a lot of messages, and I don’t feel like typing the same thing each time (plus there could me typos which could be an issue…). The first solution I thought of was to loop through all of the

How to count count the number of names Java

Hi guys. I’m new to Java, currently learning Strings. I have a task to count the number of names, the length of the name must be at least two, the first letter of the name should start with upper case, the second with lower case. The issue is that I don’t know how to use the Character.isUpperCase(text.charAt(i)) and Character.isLowerCase(text.charAt(i +

Advertisement