Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7880575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:10:43+00:00 2026-06-03T04:10:43+00:00

This is my code: Pattern p = Pattern.compile(:\\s(.+)\\s[cfs]); Matcher m1 = p.matcher(Seat 9: -FACERAPE-

  • 0

This is my code:

Pattern p = Pattern.compile(":\\s(.+)\\s[cfs]");
Matcher m1 = p.matcher("Seat 9: -FACERAPE- folded before Flop");
String name = null;
while(m1.find()){
    name = m1.group(1);
}
System.out.println(name);

I tried this regex pattern here and it works there but in my IDE it does not work. I use Eclipse with jdk 1.6. Also my regex works with these examples: Seat 7: Goldball31 folded before Flop, Seat 4: <*{{{>< collected (3.09). As you see problem is in hyphen but I did not get what a problem.
Oh sorry forget that it prints “null”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:10:44+00:00Added an answer on June 3, 2026 at 4:10 am

    I don’t see anything wrong, but your regular expression should be:

    :\\s(.+?)\\s[cfs]
    

    or

    :\\s(\\S+)\\s[cfs]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code does not return the correct result: Pattern p=Pattern.compile(^[y]{1,4}$|^[m]{1,4}$|^[d]{1,4}$); String text1=yyyy; String text2=mmm;
I use this code: static Pattern escaper = Pattern.compile(([^a-zA-z0-9])); public static String escapeRE(String str)
In this statement, taken from the Pagerank source code: Pattern.compile(\\[.+?\\]); What does the pattern
I have this code to public static String ProcessTemplateInput(String input, int count) { Pattern
This is our code: import java.io.File; import java.io.FileNotFoundException; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern;
I have this regex code I use in my code: pattern = re.compile('\d{3,4}(\/?)(\d{6,6})') m=
i have the following code Pattern keyPattern = Pattern.compile(key); Matcher matcher = keyPattern.matcher(str); return
I have this code, but it does not seem to be working. Pattern pattern=Pattern.compile(IMGURSESSION=([0-9a-zA-Z]*););
I'm learning to use Java's Pattern and Matcher, and this is an example code
Is there a pattern that I could apply to refactor this code? The only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.