RepExp Pattern Problem 
Author Message
 RepExp Pattern Problem

hihi.
I have a problem on regExp pattern.

str = "Name 'Picture' 'Yahoo' EXPERT "

I want to get the "'Picture' 'Yahoo'"
How to do it?

I try to use pattern = "NAME([^\]]*)"
It return "'Picture' 'Yahoo' EXPERT "

I try pattern  = "NAME(\s'[\D]*'\s)"
No return.

Could anyone help me? Thanks

Florence



Sun, 10 Oct 2004 02:56:39 GMT  
 RepExp Pattern Problem
Regular expressions look for patterns. You say what you want in one instance,
but you don't say why you want it. Is it all the characters between single
quotes? Is it all the characters between "name" and "expert"? Is it the two
space-delimited strings after "name"?

I can give you a pattern that will work in this case, but without knowing the
rules, it probably won't work in another case.

  str = "Name 'Picture' 'Yahoo' EXPERT ";
  re = /'.*'/;
  WScript.echo(re.exec(str));

--
People are like stained glass windows: they sparkle and shine when the sun is
out, but when the darkness sets in their true beauty is revealed only if there
is a light within. -Elizabeth Kubler-Ross

=-=-=
Steve
-=-=-


Quote:
> hihi.
> I have a problem on regExp pattern.

> str = "Name 'Picture' 'Yahoo' EXPERT "

> I want to get the "'Picture' 'Yahoo'"
> How to do it?

> I try to use pattern = "NAME([^\]]*)"
> It return "'Picture' 'Yahoo' EXPERT "

> I try pattern  = "NAME(\s'[\D]*'\s)"
> No return.

> Could anyone help me? Thanks

> Florence



Sun, 10 Oct 2004 19:03:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. patterns within patterns ?

2. pattern within a pattern ?

3. RegExp pattern-matching problem

4. Fix for Pattern XStep/YStep problem in Ghostscript 3.5x

5. RegExp pattern-matching problem

6. Problem with pattern operator HELP needed

7. RegExp pattern-matching problem

8. RegExp to find Start Pattern <anything or nothing> End Pattern

9. pattern

10. regexp pattern and dictionary obj

11. RegExp patterns

12. RegExp Pattern for Matching a URL?

 

 
Powered by phpBB® Forum Software