Link to home
Start Free TrialLog in
Avatar of ipulse2
ipulse2

asked on

regex

hi

Im trying to match the regular expression " " (DOUBLEQUOTE SPACE DOUBLEQUOTE)
would it be ...
\"([\ ])\"
 ...?

thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

try:
String pattern = "\"\ \"";
actually just:
String pattern = "\" \"";
Avatar of ipulse2
ipulse2

ASKER

im trying to match it in jflex but it doesnt like it
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ipulse2

ASKER

Exception in thread "main" java.lang.Error: Error: could not match input
at grammar.Yylex.yy_scanError(Yylex.java:442)

where its declared as ...
STRCST                  = \"(%[a-z])(%.)*\"|\" \"

Also tried matching it directly ...
      "\" \""                  { return token(sym.STRINGCONST); }

it matches the other string constants i need like "%n" etc