Please read Writeup Formatting Tips, in particular the part about code tags (<c>). You'd probably also benefit from reading How (Not) To Ask A Question, in this case because showing some sample strings and their transformations would avoid ambiguity in meaning.
Good references on dealing with regular expressions are in perlre and perlretut. Assuming you've read the string "/question Hello, how are you? /reply I'm fine." into $string and want to change that to " Hello, how are you? I'm fine.", you could use the code:
$string =~ s/\/\S+//g;
This will remove all occurrences of a forward slash (\/) followed by all characters which are not white space (\S+), removing such elements as \question, \reply, \45sa%%df2, .... The g tells the engine to match repeatedly.
In reply to Re: removing characters using regex
by kennethk
in thread removing characters using regex
by nirali
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |