[Gambas-user] Regexp pattern in string question

Benoît Minisini gambas at ...1...
Wed Jun 17 17:40:03 CEST 2009


> Hi, has anyone dealed with regexp patterns, how to define this regexp
> pattern in a string?
>
> ^(/\S+) - - /\[(/\d+)/\w+/\d{4}:(/\d+):/\d+:/\d+ [/\d+-]+/\]!]"
>
> So for example :
>
> DIM sPattern as String = "^(/\S+) - -
> /\[(/\d+)/\w+/\d{4}:(/\d+):/\d+:/\d+ [/\d+-]+/\]!]"
>
> RegExpFind (sPattern, "text to search")
>
> IDE reports "Bad Character Constant in string..."  as error, it's not
> happy with all those / and \ chars I guess.
>
> They are difficult enough already if I have to exacpe them ones more,
> i'm lost ;-)
>
> I'm trying to parse apache log with it (getting client ip adress/time/date)
> Maybe Scan() is a better option, anyone dealed with this dilemma?
>
> Regards,
> Ron_2nd.
>

"\" must be doubled.

-- 
Benoît




More information about the User mailing list