"$ "giving mule expression error in regex - mule

I am trying to match my input field to a regex expression. But it gives mule-expression error,
regex: ^(?:[1-9][0-9]?(?:\.[0-9]{2})?|100(?:\.0{2})?)$
Exception: Unable to resolve reference of $. at 1 : 1"
evaluating expression:
Please help me in resolving this issue

Please add "\" before $ and it will work

Related

"Error: unterminated parenthesized expression" when using function of object after parenthesis

i'm running into the problem:
Error: unterminated parenthesized expression
when trying to compile:
expiry_epoch = (expiry_date_bytes.pointer(expiry_date_bytes.size) as Int64*).value
I'm not that comfortable with crystal so i'm better off asking.
The only fix in my mind is:
expiry_epoch = expiry_date_bytes.pointer(expiry_date_bytes.size) as Int64*
expiry_epoch = expiry_epoch.value
Thanks in advance!
That as syntax is very old and effectively obsolete by now.
You can write expiry_date_bytes.pointer(expiry_date_bytes.size).as(Int64*).value

How to fix velocity ParseErrorException lexical error

Hi i am totally new to apache velocity and i am having velocity.exception.ParseErrorException: Lexical error issue in my code, Can anybody help me in how to solve it?
Here is the code
#set ($file_name = ${ctx.FILE_NAME}.split('_REPORT'))
$file_name.get(0) - Some Text
And here is the error I am getting
Caused by: org.apache.velocity.exception.ParseErrorException: Lexical error, Encountered: "s" (115), after : "." at *unset*[line 1, column 37]
at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1301) ~[velocity-1.7.jar:1.7]
Can anybody help me to solve this?
Try:
#set ($file_name = ${ctx.FILE_NAME.split('_REPORT')})
$file_name.get(0) - Some Text
Or just:
#set ($file_name = $ctx.FILE_NAME.split('_REPORT'))
$file_name.get(0) - Some Text
Curly braces are only here to disambiguate a reference from surrounding text.

ZSH function not working with a "Missing end of string" error

I'm teaching myself to write zsh functions and I'm stumped right away with a string error I don't understand. I have this function:
function copyToDrafts() {
print($1)
}
in my command line editor (Terminal) I type:
copyToDrafts "test"
and receive this error:
copyToDrafts:1: missing end of string
I couldn't find any explanation on the error message and can't see anything wrong with what I am passing, though obviously something is wrong. Any help would be appreciated.
The parentheses are not part of the syntax; they are interpreted as introducing a glob qualifier on the pattern print. After parameter expansion, the pattern to be evaluated is
print(test)
with the following glob qualifiers:
t - match files named print that have their sticky bits set
e execute a shell command. s acts as the delimiter, but there is no "closing" s, which produces the observed error.
You simply need to drop the parentheses.
copyToDrafts () {
print $1
}

Redshift Regex count. Repetition operator error

I am trying to do a simple regex pattern match in Redshift
I have this code and I get the following error:
REGEXP_COUNT ( "code", '^(?=.{8}$)[A-z]{2,5}[0-9]{3,6}$' )
ERROR: Invalid preceding regular expression prior to repetition operator. The error occured while parsing the regular expression fragment: '^(?>>>HERE>>>=.{8}$)[A-'.
The pattern works fine in testing in python and online checkers I'm guessing its a REGEX language problem. I have checked in PostgreSQL documentation on REGEX to try get help as I can't find much details on actual Redshift.
Thanks,

Splunk :: Search String with Special Character

I am trying to below search String in splunk
index=imdc_vms sourcetype=hadoop:app:compass:services TimeoutException with args[/mapr
but it is giving error message
Error in 'SearchParser': Missing a search command before '/'. Error at position '88' of search query 'search index=imdc_vms sourcetype=hadoop:app:compas...{snipped} {errorcontext = with args[/mapr}'.
Can you please help to resolve this . I understand this is happening because of presence of forward slash "/" but even escape sequence similar to other language did not worked in splunk .
Try quoting the last part of the search string:
index=imdc_vms sourcetype=hadoop:app:compass:services "TimeoutException with args[/mapr"