How can i write a regular expression to extract string starting with S and ends with 'E'.
I have used like this.
rex "^S(?<LOC>[.]*)E$"
, but not working ??
can you pls help
Your carrot indicates that you want to capture from the beginning of the line. You want to search within the text so try:
| rex field=_raw "S(?<LOC>\w*)E"
What if I have to capture somewhere in the middle of the line , not from the begining , how rex can be used here .Please suggest
Your carrot indicates that you want to capture from the beginning of the line. You want to search within the text so try:
| rex field=_raw "S(?<LOC>\w*)E"
You are most welcome, please mark the answer as accepted if we have answered your question. Thanks!
Thank you alacercogitatus
Like This: | rex field=_raw "(?<LOC>S\w*E)"
Just put them inside the matching group instead of outside.
how can include both S and E as well in the word extraction ??