Questions tagged [metacharacters]

metacharacters are non-alphanumeric characters which are part of the processing model of a program rather than the literal value of a string

References

84 questions
-1
votes
2 answers

How can I properly stop and start metacharacter interpolation in regexp in Perl

Editing to be more concise, pardon. I need to be able to grep from an array using a string that may contain one of the following characters: '.', '+', '/', '-'. The string will be captured via from the user. The array contains each line of the file…
WetCheerios
  • 155
  • 7
-1
votes
1 answer

Can metacharacters be used in a regular expression as a normal character?

I was wondering if metacharacters, such as ? or *, can be used in a regular expression as a normal character instead of metacharacters. For example, I have the following text: "Hi. How are you? What time is it? Beep?" And I wanted to use regular…
-2
votes
2 answers

Omitting metacharacters in python

I want to assing a path to a variable a: a = "D:\misc\testsets\Real" How can i omit the \t metacharacter without changing the folder name?
-2
votes
1 answer

How to extract the second part of the string after the backslash in R?

I have a string 'ABC1\001ABCEFCGJS' I want to extract only 001ABCEFCGJS from this string How to do so in R? My String will be a dynamic string. So the solution should be such that function can read anything after backslash.
Arpit Gupta
  • 125
  • 1
  • 1
  • 9
-2
votes
3 answers

Java - Is it possible to store metacharacters like dot in a character variable?

Metacharacters like ., \, {, ^, |, ] can be escaped with the \ character. But char variables can only store exactly one character. So is it possible to store these special characters in char variables in Java? Maybe you only need to use the escape…
Ricky
  • 553
  • 6
  • 21
-2
votes
1 answer

How to replace all types of strings meta/alphanumeric/ using Perl or shell

sed -i 's/'$search'/'$replace'/g' $file this command is able to replace only strings..but i wanted to search and replace any kind of strings in a file Ex : if i give input $search= /jms/CodeBasev1.23* $replace= /jms/CodeBasev1.24/baseline*. it…
-2
votes
1 answer

Passing replacement string as parameter

I have a code: require 'pp' def unquote_string(string) if (string.is_a?(String)) string.gsub(/\\/,'') else string end end def filter_array_with_substitution_and_replacement(array,options={}) pp options return…
gaussblurinc
  • 3,642
  • 9
  • 35
  • 64
-3
votes
1 answer

Dangling metacharacter Java

I'm trying to search for a substring in a string and replace it. I'm using String p= "+ 0.0"; But this line gives me a dangling metacharacter error. I've tried typecasting this but it still doesn't work. How do I fix this? I want to do the…
pasha
  • 406
  • 1
  • 4
  • 17
-4
votes
1 answer

javascript metacharacters lower case letter

Assign re with a regular expression that contains a lower case letter(a-z) followed by a comma This is the question and I wrote var re =/[\Sa-z]/ and it is not working. Is there special metacharacter for lower case letter? and what does it mean…
Butee
  • 1
1 2 3 4 5
6