-1

Possible Duplicate:
Get numbers from string with regex

Hi I need to check if a string is in the following format.

case1/clientid2

In the example the case and clientid will be static but numbers will change. Is it possible using Regular expression?

2
  • 2
    Yes, it is possible. What have you tried, and what language are you using? Commented Dec 27, 2012 at 17:25
  • Your example doesn't clearly explain the string format, but it looks like you might be able to do your thing in a simpler way than using a regex. Commented Dec 27, 2012 at 17:28

1 Answer 1

3

Yes, definitely duplicate of this.

Here's the regex that you could use, case[\d]+/clientid[\d]+

Edit: Removed the escape character.

Sign up to request clarification or add additional context in comments.

2 Comments

No need to escape the '/', it has no special meaning in a regex. Well, unless the language you use requires that you escape it, and even then , the escape character may not be a backslash.
True that, I use this website and I have set up my default escape character to be '/'.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.