Top "Pattern-matching" questions

Use this tag for questions about testing whether a data structure has a particular shape or contains particular values in certain locations.

What is the use of Pattern.quote method?

I'm trying to understand Pattern.quote using the following code: String pattern = Pattern.quote("1252343% 8 567 hdfg gf^$545"); System.out.println("Pattern …

java regex pattern-matching
Scala multiple type pattern matching

I'm wondering how can I use multiple type pattern matching. I have: abstract class MyAbstract case class MyFirst extends MyAbstract …

scala types pattern-matching
How to use switch/case (simple pattern matching) in Scala?

I've found myself stuck on a very trivial thing :-] I've got an enum: object Eny extends Enumeration { type Eny = …

scala pattern-matching switch-statement
How to print lines between two patterns, inclusive or exclusive (in sed, AWK or Perl)?

I have a file like the following and I would like to print the lines between two given patterns PAT1 …

shell perl awk sed pattern-matching
Can we use match to check the type of a class

I'm new to scala, and I'm learning the match keyword now. I wanna know if we can use the keyword …

scala pattern-matching match
How to use SIFT algorithm to compute how similar two images are?

I have used the SIFT implementation of Andrea Vedaldi, to calculate the sift descriptors of two similar images (the second …

matlab pattern-matching computer-vision sift image-comparison
Non-exhaustive patterns in function

I've got a problem with this code, it should count the longest substring of the same letter in a string, …

haskell pattern-matching non-exhaustive-patterns
SQL Server LIKE containing bracket characters

Using SQL Server 2008. I have a table with the following column: sampleData (nvarchar(max)) The value for this column in …

sql sql-server pattern-matching
Glob matching, exclude all JS files

I'm a new user to gulp.js. I'd like to move all of my non-javascript files to a build directory. …

node.js pattern-matching glob gulp
Merge Multiple spaces to single space; remove trailing/leading spaces

I want to merge multiple spaces into single space(space could be tab also) and remove trailing/leading spaces. For …

r pattern-matching