Jump to content

programming logic help plz


Recommended Posts

Posted
3 minutes ago, MiryalgudaMaruthiRao said:

step 2 deniki uncle

or..you can install the spring initilizer pluing in your intellij...

 

Posted
8 minutes ago, ramudu said:

try this regex - ^[a-z]{1}[0-9]{3}$  (any a to z 1 char and followed by  3 numbers)  

thanks bro, that worked.

Regex ki practice ye na or yemi ain tips vuntaya ?

regex 101 website yeppudu aina avasaram vunte try chestha but I get confused

Posted
13 minutes ago, Barbarik said:

use regex match pattern...

 

Regex - ^a\d{3}$

you can test this pattern here - https://regex101.com/

thanks bro this  and [a-z]{1}[0-9]{3}$ both worked.

Posted
1 minute ago, usauae said:

aa regex chala chiraku ga vuntundi bro, regex logic kosam ye asking

try this AI tool...if you type in simple tems...it will give you regex..based on your requirement...

https://www.autoregex.xyz/

  • Upvote 1
Posted
12 minutes ago, uoY said:

Really bro? Language? 100 of libraries vuntayi already in ur project

VB bro supporting legacy app

Posted
1 minute ago, dasari4kntr said:

try this AI tool...if you type in simple tems...it will give you regex..based on your requirement...

https://www.autoregex.xyz/

awesome bro bookmarked this link

hope they keep it free

 

Posted
3 minutes ago, usauae said:

VB bro supporting legacy app

VB...na

inka nadustunnaya..ee VB projects...?

Posted
4 minutes ago, dasari4kntr said:

VB...na

inka nadustunnaya..ee VB projects...?

Yemi cheppamantavu bro we still have vb, asp apps as old as 15 yrs

patch lu vesukuntu laagu chestunnam 

by the time I’m out of this job I will be super outdated too

Posted
Just now, usauae said:

Yemi cheppamantavu bro we still have vb, asp apps as old as 15 yrs

patch lu vesukuntu laagu chestunnam 

by the time I’m out of this job I will be super outdated too

you mean classic asp 3.0 (not asp.net)…

if yes…its super outdated…

 

Posted
40 minutes ago, dasari4kntr said:

you mean classic asp 3.0 (not asp.net)…

if yes…its super outdated…

 

SpringBootGen ani undi Adena?

Posted

you need to iterate through character by character and check isnum or isalpha and output only matching strings.

 

Posted
29 minutes ago, MiryalgudaMaruthiRao said:

SpringBootGen ani undi Adena?

spring boot helper

this gives the boiler plate...

spring boot gen...helps you with autocomplete...

 

Posted
2 hours ago, usauae said:

I have a list of strings that are always 4 characters  {'a001', 'aa01', 'aaa1', 'aaaa' }

I need to select only the ones that are  alph num num num ex: 'a001'

any ideas ?

import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Afdb {

    public static boolean isQualified(String str)
    {
        String reg = "^[a-zA-Z]{1}\\d{3}$";


        Pattern pattern = Pattern.compile(reg);

        if (str == null) {
            return false;
        }


        Matcher m = pattern.matcher(str);


        return m.matches();
    }

    public static void main(String[] args) {
        String[] myArray =  {"a001", "aa01", "aaa1", "aaaa","a0001" };

        Arrays.asList(myArray)
                .stream()
                .filter(element -> Afdb.isQualified(element))
                .map(element -> "string: " + element)
                .forEach(System.out::println);
    }
}
Posted
4 minutes ago, csrcsr said:
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Afdb {

    public static boolean isQualified(String str)
    {
        String reg = "^[a-zA-Z]{1}\\d{3}$";


        Pattern pattern = Pattern.compile(reg);

        if (str == null) {
            return false;
        }


        Matcher m = pattern.matcher(str);


        return m.matches();
    }

    public static void main(String[] args) {
        String[] myArray =  {"a001", "aa01", "aaa1", "aaaa","a0001" };

        Arrays.asList(myArray)
                .stream()
                .filter(element -> Afdb.isQualified(element))
                .map(element -> "string: " + element)
                .forEach(System.out::println);
    }
}

Adhurs Helana GIF - Adhurs Helana Brahmi - Discover & Share GIFs

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...