Hi everyone,
I'm almost tearing my hairs to find a valid regexp which will match EVERY character in a string, including the question mark!
Specifically I need to match a string which contains the word (example) "stringtobematched" at the end of it.
Everyone would suggest this:
^(.*)
stringtobematched$
This obviously works, but it stops working if I introduce the question mark (?) character at any point before the matching pattern.
For example:
blablabla
?bla
stringtobematched
..will not be matched!
It looks like that the "." (dot) character doesn't match the question mark.
Is there a regexp which matches every characters question marks included? (not necessarily matching only strings with question marks, but optionally)
I've tried something like this:
(.*)[\?](.*)blastringtobematched?
But it didn't work
Any help?
Thanks!
PS: regexp being used from Apache's mod_rewrite. Writing in this forum because after all regexp's are still considered part of shell scripting. Apologies in case I was wrong!