Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Java matches regular expression

Posted on 2013-11-24
2
Medium Priority
?
305 Views
Last Modified: 2013-11-24
Hi,
I have this regular expression which i would be using with matches..

String reg = "(?:\\s|\\A)[##]+([A-Za-z0-9-_]+)";

What does this mean? there is ? and etc...To me, it looks, like the string must start with s or A followed by the hash sign and then, it should words ...Is this right ?
0
Comment
Question by:zizi21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Matthew Kelly earned 2000 total points
ID: 39672919
Here is a list of all the regular expression codes that you can use as future reference: http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/

The expression would find a string that started with either "\A##" or "\s##" and then was followed by a string of letters, numbers or a dash or underscore.

So for example "\s##TestingRegEx" would match.

You can test it here, highlighted over each part even outlines what each one means:

http://gskinner.com/RegExr/
0
 

Author Closing Comment

by:zizi21
ID: 39673067
Thanks a lot.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question